washday-sdk 0.0.21 → 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) {
|
package/dist/api/stores/put.js
CHANGED
|
@@ -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
|
-
const response = yield axiosInstance_1.default.put(`${GET_SET_STORES}/${storeId}`,
|
|
29
|
-
return
|
|
27
|
+
const response = yield axiosInstance_1.default.put(`${GET_SET_STORES}/${storeId}`, data, config);
|
|
28
|
+
return response.data || {};
|
|
30
29
|
}
|
|
31
30
|
catch (error) {
|
|
32
31
|
console.error('Error fetching getStoreById:', error);
|
package/package.json
CHANGED
package/src/api/axiosInstance.ts
CHANGED
|
@@ -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) {
|
package/src/api/stores/put.ts
CHANGED
|
@@ -12,8 +12,8 @@ export const updateStoreById = async function (this: WashdayClientInstance, stor
|
|
|
12
12
|
const config = {
|
|
13
13
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
14
14
|
};
|
|
15
|
-
const response = await axiosInstance.put(`${GET_SET_STORES}/${storeId}`,
|
|
16
|
-
return response.data
|
|
15
|
+
const response = await axiosInstance.put(`${GET_SET_STORES}/${storeId}`, data, config);
|
|
16
|
+
return response.data || {}
|
|
17
17
|
} catch (error) {
|
|
18
18
|
console.error('Error fetching getStoreById:', error);
|
|
19
19
|
throw error;
|