MCPcopy Create free account
hub / github.com/CloudBoost/cloudboost / save

Method save

sdk/src/CloudTable.js:164–199  ·  view source on GitHub ↗

* Saves a table * * @param callback * @returns {*}

(callback)

Source from the content-addressed store, hash-verified

162 */
163
164 save(callback){
165 var def;
166 if (!callback) {
167 def = new CB.Promise();
168 }
169 CB._validate();
170 var thisObj = this;
171 var params=JSON.stringify({
172 key:CB.appKey,
173 data:CB.toJSON(thisObj)
174 });
175
176 var thisObj = this;
177
178 var url = CB.apiUrl +'/app/' + CB.appId + "/" + thisObj.document.name;
179
180 CB._request('PUT',url,params,true).then(function(response){
181 response = JSON.parse(response);
182 thisObj = CB.fromJSON(response);
183 if (callback) {
184 callback.success(thisObj);
185 } else {
186 def.resolve(thisObj);
187 }
188 },function(err){
189 if(callback){
190 callback.error(err);
191 }else {
192 def.reject(err);
193 }
194 });
195
196 if (!callback) {
197 return def.promise;
198 }
199 }
200}
201
202Object.defineProperty(CloudTable.prototype,'columns',{

Callers 15

_saveSettingsFunction · 0.45
changeUrlFunction · 0.45
cloudboost.jsFile · 0.45
enableFunction · 0.45
test.jsFile · 0.45
CloudFile.jsFile · 0.45
FileACL.jsFile · 0.45
test.jsFile · 0.45
acl.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected