@8ms/helpers 1.3.18 → 1.3.19
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/axios/get.js +2 -2
- package/axios/post.js +2 -2
- package/package.json +1 -1
package/axios/get.js
CHANGED
|
@@ -15,8 +15,8 @@ const get = async ({ config = {}, url }) => {
|
|
|
15
15
|
if (undefined !== response.data.body && undefined !== response.data.error && undefined !== response.data.state) {
|
|
16
16
|
return new ApiResponse_1.default(response.data);
|
|
17
17
|
}
|
|
18
|
-
// General success
|
|
19
|
-
else if (200
|
|
18
|
+
// General success - some APIs report 201
|
|
19
|
+
else if (response.status >= 200 && response.status <= 299) {
|
|
20
20
|
return (new ApiResponse_1.default()).setToSuccess({
|
|
21
21
|
body: response.data,
|
|
22
22
|
});
|
package/axios/post.js
CHANGED
|
@@ -15,8 +15,8 @@ const post = async ({ config = {}, data = {}, url }) => {
|
|
|
15
15
|
if (undefined !== response.data.body && undefined !== response.data.error && undefined !== response.data.state) {
|
|
16
16
|
return new ApiResponse_1.default(response.data);
|
|
17
17
|
}
|
|
18
|
-
// General success
|
|
19
|
-
else if (200
|
|
18
|
+
// General success - some APIs report 201
|
|
19
|
+
else if (response.status >= 200 && response.status <= 299) {
|
|
20
20
|
return (new ApiResponse_1.default()).setToSuccess({
|
|
21
21
|
body: response.data,
|
|
22
22
|
});
|