|
142 |
else { |
142 |
else { |
143 |
return this._genericMultiCmd(type, [param]). |
143 |
return this._genericMultiCmd(type, [param]). |
144 |
then(function(results) { |
144 |
then(function(results) { |
145 |
if (results && results instanceof Array) { |
145 |
if (results) |
146 |
return results[0]; |
146 |
if (results instanceof Array) { |
|
|
147 |
// 200 |
148 |
return results[0]; |
149 |
} else { |
150 |
// validation error in singleCmd (put, add, ...) |
151 |
return {'status' : 201, 'result' : results['0']['object']}; |
152 |
} |
147 |
} |
153 |
} |
148 |
}); |
154 |
}); |
149 |
} |
155 |
} |
|
156 |
} |
162 |
} |
157 |
else { |
163 |
else { |
158 |
// send the UMCP command |
164 |
// send the UMCP command |
159 |
return this.umcpCommand(this.storePath + '/' + type, params). |
165 |
return this.umcpCommand(this.storePath + '/' + type, params, false). |
160 |
then(/*REQUIRE:"dojo/_base/lang"*/ lang.hitch(this, function(data) { |
166 |
then(/*REQUIRE:"dojo/_base/lang"*/ lang.hitch(this, function(data) { |
161 |
// make sure that we get an non-empty array |
167 |
// make sure that we get an non-empty array |
162 |
//console.log('# _genericMultiCmd - deferred: data=' + String(data)); |
168 |
//console.log('# _genericMultiCmd - deferred: data=' + String(data)); |