fix getPersistentData

pull/232/head
nightwing 2016-01-09 03:43:09 +04:00
rodzic ac11de256d
commit c0356ee1e3
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -598,7 +598,7 @@ define(function(require, exports, module) {
api[type].get("persistent/" + apiKey, function(err, data){
if (err) return callback(err);
try { callback(null, JSON.stringify(data)); }
try { callback(null, JSON.parse(data)); }
catch(e){ return callback(e); }
});
}
@ -613,7 +613,11 @@ define(function(require, exports, module) {
else if (context == "workspace") type = "project";
else throw new Error("Unsupported context: " + context);
api[type].put("persistent/" + apiKey, { data: JSON.stringify(data) }, callback);
api[type].put("persistent/" + apiKey, {
body: {
data: JSON.stringify(data)
}
}, callback);
}
/***** Register and define API *****/