washday-sdk 0.0.20 → 0.0.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.
@@ -21,7 +21,7 @@ const getAxiosInstance = () => {
21
21
  axiosInstance.interceptors.request.use((config) => {
22
22
  const { token, contentType = 'application/json', responseType = 'json', contentDisposition } = config.params || {};
23
23
  const { Authorization } = config.headers || {};
24
- if (token) {
24
+ if (Authorization || token) {
25
25
  config.headers.Authorization = Authorization || `Bearer ${token}`;
26
26
  }
27
27
  if (contentType) {
@@ -20,13 +20,12 @@ const REQUEST_PARAMS = {
20
20
  };
21
21
  const updateStoreById = function (storeId, data) {
22
22
  return __awaiter(this, void 0, void 0, function* () {
23
- var _a;
24
23
  try {
25
24
  const config = {
26
25
  headers: { Authorization: `Bearer ${this.apiToken}` }
27
26
  };
28
27
  const response = yield axiosInstance_1.default.put(`${GET_SET_STORES}/${storeId}`, data, config);
29
- return ((_a = response.data) === null || _a === void 0 ? void 0 : _a.data) || {};
28
+ return response.data || {};
30
29
  }
31
30
  catch (error) {
32
31
  console.error('Error fetching getStoreById:', error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -21,7 +21,7 @@ const getAxiosInstance = (): AxiosInstance => {
21
21
  (config) => {
22
22
  const { token, contentType = 'application/json', responseType = 'json', contentDisposition } = config.params || {};
23
23
  const { Authorization } = config.headers || {};
24
- if (token) {
24
+ if (Authorization || token) {
25
25
  config.headers.Authorization = Authorization || `Bearer ${token}`;
26
26
  }
27
27
  if (contentType) {
@@ -13,7 +13,7 @@ export const updateStoreById = async function (this: WashdayClientInstance, stor
13
13
  headers: { Authorization: `Bearer ${this.apiToken}` }
14
14
  };
15
15
  const response = await axiosInstance.put(`${GET_SET_STORES}/${storeId}`, data, config);
16
- return response.data?.data || {}
16
+ return response.data || {}
17
17
  } catch (error) {
18
18
  console.error('Error fetching getStoreById:', error);
19
19
  throw error;