bpjs-bridge 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.
@@ -59,6 +59,9 @@ const createBpjsClient = (config) => {
59
59
  res.data = `[HTTP CLIENT ERROR => URL : ${res.config.baseURL}/${res.config.url} ] => ${"NO_CONTENT_IN_RESPONSE"}`;
60
60
  res.status = 204;
61
61
  res.statusText = "No Content";
62
+ if (res.config.method?.toLowerCase() === "delete") {
63
+ return res;
64
+ }
62
65
  const AxiosError = {
63
66
  name: "BpjsResponseError",
64
67
  code: "NO_CONTENT_IN_RESPONSE",
@@ -73,7 +76,21 @@ const createBpjsClient = (config) => {
73
76
  headers: res.headers,
74
77
  config: res.config,
75
78
  },
76
- toJSON: () => ({}),
79
+ toJSON: () => ({
80
+ name: "BpjsResponseError",
81
+ code: "NO_CONTENT_IN_RESPONSE",
82
+ message: res.data,
83
+ status: res.status,
84
+ config: res.config,
85
+ isAxiosError: true,
86
+ response: {
87
+ data: res.data,
88
+ status: res.status,
89
+ statusText: res.statusText,
90
+ headers: res.headers,
91
+ config: res.config,
92
+ },
93
+ }),
77
94
  };
78
95
  return Promise.reject(AxiosError);
79
96
  }, (err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpjs-bridge",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "Integrasi BPJS PCare, Antrean FKTP, VClaim, dan iCare dengan dukungan Redis Cache, Logging, dan Modular Service Architecture. ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",