ag-common 0.0.110 → 0.0.111

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.
@@ -79,13 +79,6 @@ const callOpenApi = ({ func, apiUrl, overrideAuth, refreshToken, logout, newDefa
79
79
  // eslint-disable-next-line no-await-in-loop
80
80
  yield (0, sleep_1.sleep)(2000);
81
81
  }
82
- return {
83
- data,
84
- error,
85
- loading: false,
86
- reFetch: () => __awaiter(void 0, void 0, void 0, function* () { return func(cl); }),
87
- url: func.toString(),
88
- datetime: new Date().getTime(),
89
- };
82
+ return Object.assign(Object.assign({ data }, (error && { error })), { loading: false, reFetch: () => __awaiter(void 0, void 0, void 0, function* () { return func(cl); }), url: func.toString(), datetime: new Date().getTime() });
90
83
  });
91
84
  exports.callOpenApi = callOpenApi;
@@ -51,7 +51,7 @@ export interface User {
51
51
  }
52
52
  export interface AxiosWrapper<T> {
53
53
  data: T;
54
- error: AxiosError<unknown, any> | undefined;
54
+ error?: AxiosError<unknown, any>;
55
55
  loading: boolean;
56
56
  reFetch: () => Promise<any>;
57
57
  url: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-common",
3
- "version": "0.0.110",
3
+ "version": "0.0.111",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Andrei Gec <@andreigec> (https://gec.dev/)",