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,
|
|
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
package/src/api/axiosInstance.ts
CHANGED
|
@@ -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,
|
|
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
|
}
|