remult 0.14.21 → 0.14.22

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.
@@ -3,7 +3,7 @@ import axios from 'axios';
3
3
  import { HttpProviderBridgeToRestDataProviderHttpProvider, Remult } from '../context';
4
4
  import { Entity, Fields } from '../remult3';
5
5
  import { Action, BackendMethod } from '../server-action';
6
- Remult.apiBaseUrl = 'http://localhost:3001/api';
6
+ Remult.apiBaseUrl = 'http://localhost:3000/api';
7
7
  const path = Remult.apiBaseUrl + '/tasks';
8
8
  fit("works", async () => {
9
9
  const repo = await create3Tasks();
@@ -46,7 +46,7 @@ export class Action {
46
46
  res.success(r);
47
47
  }
48
48
  catch (err) {
49
- if (err instanceof ForbiddenError)
49
+ if (err.isForbiddenError)
50
50
  res.forbidden();
51
51
  else
52
52
  res.error(err);
@@ -58,6 +58,7 @@ Action.apiUrlForJobStatus = 'jobStatusInQueue';
58
58
  class ForbiddenError extends Error {
59
59
  constructor() {
60
60
  super("Forbidden");
61
+ this.isForbiddenError = true;
61
62
  }
62
63
  }
63
64
  export class myServerAction extends Action {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "0.14.21",
3
+ "version": "0.14.22",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -6,7 +6,7 @@ var axios_1 = require("axios");
6
6
  var context_1 = require("../context");
7
7
  var remult3_1 = require("../remult3");
8
8
  var server_action_1 = require("../server-action");
9
- context_1.Remult.apiBaseUrl = 'http://localhost:3001/api';
9
+ context_1.Remult.apiBaseUrl = 'http://localhost:3000/api';
10
10
  var path = context_1.Remult.apiBaseUrl + '/tasks';
11
11
  fit("works", function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
12
12
  var repo, tasks, _a;
@@ -81,7 +81,7 @@ var Action = /** @class */ (function () {
81
81
  return [3 /*break*/, 3];
82
82
  case 2:
83
83
  err_1 = _a.sent();
84
- if (err_1 instanceof ForbiddenError)
84
+ if (err_1.isForbiddenError)
85
85
  res.forbidden();
86
86
  else
87
87
  res.error(err_1);
@@ -98,7 +98,9 @@ exports.Action = Action;
98
98
  var ForbiddenError = /** @class */ (function (_super) {
99
99
  tslib_1.__extends(ForbiddenError, _super);
100
100
  function ForbiddenError() {
101
- return _super.call(this, "Forbidden") || this;
101
+ var _this = _super.call(this, "Forbidden") || this;
102
+ _this.isForbiddenError = true;
103
+ return _this;
102
104
  }
103
105
  return ForbiddenError;
104
106
  }(Error));