@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/rest.js +10 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@karpeleslab/klbfw",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Frontend Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
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
- return __platformAsyncRest(name, verb, params, ctx_final);
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