@knovator/pagecreator-admin 0.0.2 → 0.0.3

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/index.js CHANGED
@@ -2705,12 +2705,15 @@ const commonApi = ({
2705
2705
  getToken: apiToken,
2706
2706
  onError: _onError
2707
2707
  });
2708
- return fetchUrl({
2708
+ const response = yield fetchUrl({
2709
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2710
+ // @ts-ignore
2709
2711
  type: method,
2710
2712
  url,
2711
2713
  data,
2712
2714
  config
2713
2715
  });
2716
+ return response;
2714
2717
  });
2715
2718
 
2716
2719
  const getApiType = ({
@@ -1,5 +1,5 @@
1
- import { ACTION_TYPES, API_TYPE, BaseAPIProps, Routes_Input } from '../types';
2
- declare const commonApi: ({ data, config, baseUrl, token, url, method, onError, }: BaseAPIProps) => Promise<any>;
1
+ import { ACTION_TYPES, API_TYPE, BaseAPIProps, Routes_Input, ResponseType } from '../types';
2
+ declare const commonApi: ({ data, config, baseUrl, token, url, method, onError, }: BaseAPIProps) => Promise<ResponseType>;
3
3
  declare const getApiType: ({ routes, action, prefix, id, }: {
4
4
  routes?: Routes_Input | undefined;
5
5
  action: ACTION_TYPES;
@@ -27,3 +27,8 @@ export interface BaseAPIProps {
27
27
  method: string;
28
28
  onError?: (error: Error) => void;
29
29
  }
30
+ export interface ResponseType {
31
+ message: string;
32
+ code: 'SUCCESS' | 'FAILED';
33
+ data: any;
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knovator/pagecreator-admin",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "dependencies": {
5
5
  "classnames": "^2.3.1",
6
6
  "react-beautiful-dnd": "^13.1.0",
@@ -8,7 +8,7 @@
8
8
  "react-hook-form": "^7.34.2",
9
9
  "react-dropzone": "^14.2.2",
10
10
  "react-select": "^5.4.0",
11
- "@knovator/api": "^0.0.10"
11
+ "@knovator/api": "^1.0.2"
12
12
  },
13
13
  "peerDependencies": {
14
14
  "react": "^18"