@dexyn/common-library 1.0.11 → 1.0.12
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.
- package/api/apiClientUtils.js +2 -1
- package/package.json +1 -1
package/api/apiClientUtils.js
CHANGED
@@ -39,12 +39,13 @@ const createApiClient = (basePath) => {
|
|
39
39
|
});
|
40
40
|
if (!response.ok) {
|
41
41
|
const errorData = await response.json();
|
42
|
-
|
42
|
+
return errorData;
|
43
43
|
}
|
44
44
|
// Handle no content for 202 or other no-body status codes
|
45
45
|
if (response.status === 202 || response.status === 204 || !response.headers.get('Content-Type')) {
|
46
46
|
return {};
|
47
47
|
}
|
48
|
+
// Return parsed JSON for non-void responses
|
48
49
|
return await response.json();
|
49
50
|
};
|
50
51
|
return {
|