slight reorganization refactor

This commit is contained in:
Max Ogden 2011-08-04 13:36:28 -04:00
parent 3797c33a2b
commit 48dbdf58f5
2 changed files with 6 additions and 1 deletions

View File

@ -80,6 +80,10 @@ var costco = function() {
});
return dfd.promise();
}
function updateDoc(doc) {
return couch.request({type: "PUT", url: app.baseURL + "api/" + doc._id, data: JSON.stringify(doc)})
}
function uploadDocs(docs) {
var dfd = $.Deferred();
@ -139,6 +143,7 @@ var costco = function() {
previewTransform: previewTransform,
mapDocs: mapDocs,
updateDocs: updateDocs,
updateDoc: updateDoc,
uploadDocs: uploadDocs,
deleteColumn: deleteColumn,
ensureCommit: ensureCommit,

View File

@ -58,7 +58,7 @@ app.after = {
});
doc[header] = cell.parents('.data-table-cell-editor').find('.data-table-cell-editor-editor').val();
util.notify("Updating row...", {persist: true, loader: true});
couch.request({type: "PUT", url: app.baseURL + "api/" + doc._id, data: JSON.stringify(doc)}).then(function(response) {
costco.updateDoc(doc).then(function(response) {
util.notify("Row updated successfully");
recline.initializeTable();
})