@karpeleslab/klbfw 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/rest.js +10 -1
package/package.json
CHANGED
package/rest.js
CHANGED
|
@@ -9,7 +9,16 @@ module.exports.rest = (name, verb, params, context) => {
|
|
|
9
9
|
context = context || {};
|
|
10
10
|
var ctx_final = fwWrapper.getContext();
|
|
11
11
|
for (var i in context) ctx_final[i] = context[i];
|
|
12
|
-
|
|
12
|
+
var p1 = new Promise(function(resolve, reject) {
|
|
13
|
+
__platformAsyncRest(name, verb, params, ctx_final).then(function(result) {
|
|
14
|
+
if (result.result != "success") {
|
|
15
|
+
reject(result);
|
|
16
|
+
} else {
|
|
17
|
+
resolve(result);
|
|
18
|
+
}
|
|
19
|
+
}, reject);
|
|
20
|
+
});
|
|
21
|
+
return p1;
|
|
13
22
|
}
|
|
14
23
|
if (typeof __platformRest !== "undefined") {
|
|
15
24
|
// direct SSR-mode call to rest api
|