fixing json serialization
This commit is contained in:
@@ -11,7 +11,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
couch.request = function(opts) {
|
couch.request = function(opts) {
|
||||||
if (opts.data && typeof(opts.data === "object")) opts.data = JSON.stringify(opts.data);
|
|
||||||
var ajaxOpts = $.extend({}, defaults, opts);
|
var ajaxOpts = $.extend({}, defaults, opts);
|
||||||
return $.ajax(ajaxOpts).promise();
|
return $.ajax(ajaxOpts).promise();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ app.after = {
|
|||||||
});
|
});
|
||||||
doc[header] = cell.parents('.data-table-cell-editor').find('.data-table-cell-editor-editor').val();
|
doc[header] = cell.parents('.data-table-cell-editor').find('.data-table-cell-editor-editor').val();
|
||||||
util.notify("Updating row...", {persist: true, loader: true});
|
util.notify("Updating row...", {persist: true, loader: true});
|
||||||
couch.request({type: "PUT", url: app.baseURL + "api/" + doc._id, data: doc}).then(function(response) {
|
couch.request({type: "PUT", url: app.baseURL + "api/" + doc._id, data: JSON.stringify(doc)}).then(function(response) {
|
||||||
util.notify("Row updated successfully");
|
util.notify("Row updated successfully");
|
||||||
removalist.fetchRows(false, app.offset);
|
removalist.fetchRows(false, app.offset);
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user