mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
fix(edit) save if patch fail
This commit is contained in:
parent
0302ed982b
commit
246749ed66
2 changed files with 4 additions and 8 deletions
|
|
@ -116,13 +116,12 @@ var CloudCmd, Util, DOM, CloudFunc;
|
|||
});
|
||||
};
|
||||
|
||||
this.save = function(pUrl, pData, pQuery, pCallBack, pError){
|
||||
this.save = function(pUrl, pData, pQuery, pCallBack){
|
||||
sendRequest({
|
||||
method : 'PUT',
|
||||
url : CloudFunc.FS + pUrl + (pQuery || ''),
|
||||
data : pData,
|
||||
callback : pCallBack,
|
||||
error : pError,
|
||||
imgPosition : { top: true }
|
||||
});
|
||||
};
|
||||
|
|
@ -175,14 +174,11 @@ var CloudCmd, Util, DOM, CloudFunc;
|
|||
method : p.method,
|
||||
url : p.url,
|
||||
data : lData,
|
||||
error : Images.showError,
|
||||
success : function(pData) {
|
||||
Images.hideLoad();
|
||||
Util.log(pData);
|
||||
Util.exec(p.callback, pData);
|
||||
},
|
||||
error : function(pError) {
|
||||
Images.showError(pError);
|
||||
Util.exec(p.error, pError);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@ var CloudCmd, Util, DOM, JsDiff, ace;
|
|||
|
||||
Value = lValue;
|
||||
DOM.setCurrentSize( lLength, lCurrent );
|
||||
DOM.RESTfull.save( lPath, lData, lPatch, null, function (){
|
||||
if (lPatch)
|
||||
DOM.RESTfull.save( lPath, lData, lPatch, function (pData){
|
||||
if (pData === 'patch : fail. trying to save...')
|
||||
DOM.RESTfull.save( lPath, lValue);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue