From 1cc3595781284db36bb4c88ee40062f5f662af65 Mon Sep 17 00:00:00 2001 From: Bernat Romagosa Date: Wed, 25 Oct 2017 16:59:58 +0200 Subject: [PATCH] added updateNotes query --- cloud.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cloud.js b/cloud.js index 4f277c24..129272be 100644 --- a/cloud.js +++ b/cloud.js @@ -142,8 +142,8 @@ Cloud.prototype.request = function ( if (onError) { onError.call( null, - myself.url, - errorMsg || Cloud.genericErrorMessage + errorMsg || Cloud.genericErrorMessage, + myself.url ); } else { myself.genericError(); @@ -474,4 +474,16 @@ Cloud.prototype.unpublishProject = function (projectName, onSuccess, onError) { ); }; +Cloud.prototype.updateNotes = function (projectName, notes, onSuccess, onError) { + this.withCredentialsRequest( + 'POST', + '/projects/%username/' + projectName + '/metadata', + onSuccess, + onError, + 'Could not update project notes', + false, // wants raw response + JSON.stringify({ notes: notes }) + ); +}; + var SnapCloud = new Cloud('http://localhost:8080');