@bzbs/react-api-client 1.0.0 → 1.0.1

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/dist/index.mjs CHANGED
@@ -41,8 +41,10 @@ var __async = (__this, __arguments, generator) => {
41
41
  // src/api/base-service.ts
42
42
  var BaseService = class {
43
43
  constructor(client, baseUrl) {
44
- if (!client) throw new Error("Axios client is required.");
45
- if (!baseUrl) throw new Error("Base URL is required.");
44
+ if (!client)
45
+ throw new Error("Axios client is required.");
46
+ if (!baseUrl)
47
+ throw new Error("Base URL is required.");
46
48
  this.client = client;
47
49
  this.baseUrl = baseUrl;
48
50
  }
@@ -1143,7 +1145,7 @@ var HistoryApi = class extends BaseService {
1143
1145
  */
1144
1146
  redeemHistories(params, requestOptions) {
1145
1147
  return __async(this, null, function* () {
1146
- return yield this.get(
1148
+ const response = yield this.get(
1147
1149
  "redeem",
1148
1150
  __spreadValues({
1149
1151
  byConfig: params.byConfig,
@@ -1156,6 +1158,18 @@ var HistoryApi = class extends BaseService {
1156
1158
  }, params.options),
1157
1159
  requestOptions
1158
1160
  );
1161
+ if (response.type === "success") {
1162
+ const purchases = response.model.map((item) => {
1163
+ var _a, _b;
1164
+ return __spreadProps(__spreadValues({}, item), {
1165
+ ParcelNo: (_b = (_a = item.ParcelNo) != null ? _a : item.PacelNo) != null ? _b : void 0
1166
+ });
1167
+ });
1168
+ return __spreadProps(__spreadValues({}, response), {
1169
+ model: purchases
1170
+ });
1171
+ }
1172
+ return response;
1159
1173
  });
1160
1174
  }
1161
1175
  /**