washday-sdk 0.0.24 → 0.0.26

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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
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
  }