ggez-banking-sdk 0.4.24 → 0.4.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.
|
@@ -4,6 +4,10 @@ import { ResultHelper } from "./resultHelper";
|
|
|
4
4
|
import { SystemResponses } from "../../constant";
|
|
5
5
|
class ResponseHelper {
|
|
6
6
|
static onResponse = (res) => {
|
|
7
|
+
const isStringData = typeof res.data === "string";
|
|
8
|
+
if (isStringData) {
|
|
9
|
+
res.data = JSON.parse(res.data);
|
|
10
|
+
}
|
|
7
11
|
const defaultResult = {
|
|
8
12
|
code: SystemResponses.Approved,
|
|
9
13
|
message: "Operation completed successfully",
|
|
@@ -11,9 +15,12 @@ class ResponseHelper {
|
|
|
11
15
|
description: "Operation completed successfully",
|
|
12
16
|
};
|
|
13
17
|
if (!res.data.result) {
|
|
14
|
-
res.data = createDefaultBaseResult({
|
|
18
|
+
res.data.result = createDefaultBaseResult({
|
|
15
19
|
result: defaultResult,
|
|
16
20
|
});
|
|
21
|
+
if (isStringData) {
|
|
22
|
+
res.data = JSON.stringify(res.data);
|
|
23
|
+
}
|
|
17
24
|
}
|
|
18
25
|
return res;
|
|
19
26
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ggez-banking-sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.26",
|
|
4
4
|
"description": "A Node.js package to handle GGEZ Banking API endpoints, Simplify the process of managing CRUD operations with this efficient and easy-to-use package.",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|