sysone-api-mapper 1.0.203 → 1.0.204
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.
|
@@ -79,16 +79,17 @@ const apiMapper = async (endpointCode, tenant, routeParams, params = null, addit
|
|
|
79
79
|
return endpointData.responseMapper(response);
|
|
80
80
|
}
|
|
81
81
|
case endpointsConfig_1.methods.POST: {
|
|
82
|
-
const { mappedPostParams, mappedBody, headers: requestHeaders } = endpointData.requestMapper(params);
|
|
82
|
+
const { mappedPostParams, mappedBody, responseType, headers: requestHeaders, } = endpointData.requestMapper(params);
|
|
83
83
|
const response = await axiosInstance_1.default.post(url, mappedBody, {
|
|
84
84
|
...axiosConfig,
|
|
85
85
|
params: mappedPostParams,
|
|
86
|
+
responseType,
|
|
86
87
|
headers: {
|
|
87
88
|
...axiosConfig.headers,
|
|
88
89
|
...requestHeaders,
|
|
89
90
|
},
|
|
90
91
|
});
|
|
91
|
-
return endpointData.responseMapper(response.data);
|
|
92
|
+
return endpointData.responseMapper(responseType ? response : response.data);
|
|
92
93
|
}
|
|
93
94
|
case endpointsConfig_1.methods.PUT: {
|
|
94
95
|
const { mappedParams, mappedBody, headers: requestHeaders, ...otherOptions } = endpointData.requestMapper(params);
|