@uxf/cms 11.28.4 → 11.28.5

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.
@@ -1,8 +1,18 @@
1
1
  import ExtendableError from "es6-error";
2
+ interface Error {
3
+ code: string;
4
+ message: string;
5
+ }
6
+ interface ValidationError {
7
+ field: string;
8
+ message: string;
9
+ }
10
+ interface ErrorData {
11
+ error: Error;
12
+ validationErrors: ValidationError[];
13
+ }
2
14
  export declare class BadRequestError extends ExtendableError {
3
- data: any;
4
- constructor(data: {
5
- message?: string;
6
- shouldTranslate?: boolean;
7
- }, message?: string);
15
+ data: ErrorData;
16
+ constructor(data: ErrorData);
8
17
  }
18
+ export {};
@@ -6,9 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.BadRequestError = void 0;
7
7
  const es6_error_1 = __importDefault(require("es6-error"));
8
8
  class BadRequestError extends es6_error_1.default {
9
- constructor(data, message = "Bad Request") {
10
- var _a;
11
- super((_a = data.message) !== null && _a !== void 0 ? _a : message);
9
+ constructor(data) {
10
+ super(data.error.message);
12
11
  this.data = data;
13
12
  }
14
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/cms",
3
- "version": "11.28.4",
3
+ "version": "11.28.5",
4
4
  "description": "UXF Cms",
5
5
  "author": "UXFans <dev@uxf.cz>",
6
6
  "homepage": "https://gitlab.com/uxf-npm/cms#readme",