Commit 70a03f68 authored by Jake Oliversen's avatar Jake Oliversen

A few Sling changes

parent 63cb7cf3
......@@ -542,6 +542,16 @@ SC.getStream = function(path, method, headers){
* @param {function} callback - to call upon completion (err, httpStatusCode, httpResponse, body)
*/
SC.import = function(path, data, options, callback){
if(!callback || typeof(callback) !== "function"){
return new Promise((resolve, reject)=>{
this.import(path, data, options, (err, data) =>{
err ? reject(new Error(err)) : resolve(data)
});
})
}
if(typeof options === "function"){
callback=options;
options={}
......@@ -555,15 +565,6 @@ SC.import = function(path, data, options, callback){
form = _.merge(form, options.extraParams)
}
if(!callback || typeof(callback) !== "function"){
return new Promise((resolve, reject)=>{
this.import(path, data, options, (err, data) =>{
err ? reject(new Error(err)) : resolve(data)
});
})
}
// if(!options.protectNodes)
// form[':replace']="true"; // This seems to make sling fail when replacing jcr:content.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment