@bzbs/react-api-client 1.4.6 → 1.4.9
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.d.mts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +48 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -151,6 +151,21 @@ var BaseService = class {
|
|
|
151
151
|
"Content-Type": "application/json"
|
|
152
152
|
}, customHeaders);
|
|
153
153
|
}
|
|
154
|
+
setBaseUrl(baseUrl) {
|
|
155
|
+
if (baseUrl.length === 0) throw new Error("Base URL is required.");
|
|
156
|
+
this.baseUrl = baseUrl;
|
|
157
|
+
return this;
|
|
158
|
+
}
|
|
159
|
+
static createFormData(data, fileKey, file) {
|
|
160
|
+
const formData = new FormData();
|
|
161
|
+
for (const key in data) {
|
|
162
|
+
formData.append(key, data[key]);
|
|
163
|
+
}
|
|
164
|
+
if (file) {
|
|
165
|
+
formData.append(fileKey != null ? fileKey : "data", file);
|
|
166
|
+
}
|
|
167
|
+
return formData;
|
|
168
|
+
}
|
|
154
169
|
};
|
|
155
170
|
|
|
156
171
|
// src/api/auth/auth-api.ts
|
|
@@ -1760,8 +1775,7 @@ var ProfileApi = class extends BaseService {
|
|
|
1760
1775
|
return __async(this, null, function* () {
|
|
1761
1776
|
return yield this.post(
|
|
1762
1777
|
"profile/me",
|
|
1763
|
-
__spreadValues({
|
|
1764
|
-
data: params.profileImage,
|
|
1778
|
+
BaseService.createFormData(__spreadValues({
|
|
1765
1779
|
firstname: params.firstName,
|
|
1766
1780
|
lastname: params.lastName,
|
|
1767
1781
|
contact_number: params.contactNumber,
|
|
@@ -1809,7 +1823,7 @@ var ProfileApi = class extends BaseService {
|
|
|
1809
1823
|
occupation: params.occupation,
|
|
1810
1824
|
remark: params.remark,
|
|
1811
1825
|
displayname: params.displayName
|
|
1812
|
-
}, params.options),
|
|
1826
|
+
}, params.options), "profileImage", params.profileImage),
|
|
1813
1827
|
{
|
|
1814
1828
|
headers: __spreadValues({
|
|
1815
1829
|
"Content-Type": "multipart/form-data"
|
|
@@ -2726,6 +2740,37 @@ var BzbsService = class {
|
|
|
2726
2740
|
this.settingApi = new SettingApi(this.client, this.baseUrl);
|
|
2727
2741
|
this.blob = new Blob(this.client, this.baseBlobUrl);
|
|
2728
2742
|
}
|
|
2743
|
+
setBaseUrl(baseUrl) {
|
|
2744
|
+
this.baseUrl = baseUrl;
|
|
2745
|
+
this.authApi.setBaseUrl(baseUrl);
|
|
2746
|
+
this.badgeApi.setBaseUrl(baseUrl);
|
|
2747
|
+
this.campaignApi.setBaseUrl(baseUrl);
|
|
2748
|
+
this.cartApi.setBaseUrl(baseUrl);
|
|
2749
|
+
this.categoryApi.setBaseUrl(baseUrl);
|
|
2750
|
+
this.consentApi.setBaseUrl(baseUrl);
|
|
2751
|
+
this.couponApi.setBaseUrl(baseUrl);
|
|
2752
|
+
this.dashboardApi.setBaseUrl(baseUrl);
|
|
2753
|
+
this.historyApi.setBaseUrl(baseUrl);
|
|
2754
|
+
this.notificationApi.setBaseUrl(baseUrl);
|
|
2755
|
+
this.placeApi.setBaseUrl(baseUrl);
|
|
2756
|
+
this.pointLogApi.setBaseUrl(baseUrl);
|
|
2757
|
+
this.profileApi.setBaseUrl(baseUrl);
|
|
2758
|
+
this.registerApi.setBaseUrl(baseUrl);
|
|
2759
|
+
this.addressApi.setBaseUrl(baseUrl);
|
|
2760
|
+
this.stampApi.setBaseUrl(baseUrl);
|
|
2761
|
+
this.forumApi.setBaseUrl(baseUrl);
|
|
2762
|
+
this.settingApi.setBaseUrl(baseUrl);
|
|
2763
|
+
return this;
|
|
2764
|
+
}
|
|
2765
|
+
setBlobUrl(blobUrl) {
|
|
2766
|
+
this.blob.setBaseUrl(blobUrl);
|
|
2767
|
+
return this;
|
|
2768
|
+
}
|
|
2769
|
+
setLineUrl(lineUrl) {
|
|
2770
|
+
var _a;
|
|
2771
|
+
(_a = this.lineApi) == null ? void 0 : _a.setBaseUrl(lineUrl);
|
|
2772
|
+
return this;
|
|
2773
|
+
}
|
|
2729
2774
|
};
|
|
2730
2775
|
export {
|
|
2731
2776
|
AddressApi,
|