washday-sdk 0.0.24 → 0.0.25

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.
@@ -19,8 +19,9 @@ const getAxiosInstance = () => {
19
19
  });
20
20
  // Add interceptor to set token and other options for every request
21
21
  axiosInstance.interceptors.request.use((config) => {
22
- const { token, contentType = 'application/json', responseType = 'json', contentDisposition } = config.params || {};
22
+ const { token, responseType = 'json', contentDisposition } = config.params || {};
23
23
  const { Authorization } = config.headers || {};
24
+ const contentType = config.headers['Content-Type'] || 'application/json';
24
25
  if (Authorization || token) {
25
26
  config.headers.Authorization = Authorization || `Bearer ${token}`;
26
27
  }
@@ -23,7 +23,7 @@ const createStoreImage = function (data) {
23
23
  return __awaiter(this, void 0, void 0, function* () {
24
24
  try {
25
25
  const config = {
26
- headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': 'multipart/form-data' }
26
+ headers: { Authorization: `Bearer ${this.apiToken}`, contentType: 'multipart/form-data' }
27
27
  };
28
28
  const response = yield axiosInstance_1.default.post(`${GET_SET_STORE_IMAGE}`, data, config);
29
29
  return response;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -19,8 +19,9 @@ const getAxiosInstance = (): AxiosInstance => {
19
19
  // Add interceptor to set token and other options for every request
20
20
  axiosInstance.interceptors.request.use(
21
21
  (config) => {
22
- const { token, contentType = 'application/json', responseType = 'json', contentDisposition } = config.params || {};
22
+ const { token, responseType = 'json', contentDisposition } = config.params || {};
23
23
  const { Authorization } = config.headers || {};
24
+ const contentType = config.headers['Content-Type'] || 'application/json';
24
25
  if (Authorization || token) {
25
26
  config.headers.Authorization = Authorization || `Bearer ${token}`;
26
27
  }
@@ -12,7 +12,7 @@ const REQUEST_PARAMS = {
12
12
  export const createStoreImage = async function (this: WashdayClientInstance, data: any): Promise<any> {
13
13
  try {
14
14
  const config = {
15
- headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': 'multipart/form-data' }
15
+ headers: { Authorization: `Bearer ${this.apiToken}`, contentType: 'multipart/form-data' }
16
16
  };
17
17
  const response = await axiosInstance.post(`${GET_SET_STORE_IMAGE}`, data, config);
18
18
  return response;