@bzbs/react-api-client 1.4.8 → 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.mjs CHANGED
@@ -156,6 +156,16 @@ var BaseService = class {
156
156
  this.baseUrl = baseUrl;
157
157
  return this;
158
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
+ }
159
169
  };
160
170
 
161
171
  // src/api/auth/auth-api.ts
@@ -1765,8 +1775,7 @@ var ProfileApi = class extends BaseService {
1765
1775
  return __async(this, null, function* () {
1766
1776
  return yield this.post(
1767
1777
  "profile/me",
1768
- __spreadValues({
1769
- data: params.profileImage,
1778
+ BaseService.createFormData(__spreadValues({
1770
1779
  firstname: params.firstName,
1771
1780
  lastname: params.lastName,
1772
1781
  contact_number: params.contactNumber,
@@ -1814,7 +1823,7 @@ var ProfileApi = class extends BaseService {
1814
1823
  occupation: params.occupation,
1815
1824
  remark: params.remark,
1816
1825
  displayname: params.displayName
1817
- }, params.options),
1826
+ }, params.options), "profileImage", params.profileImage),
1818
1827
  {
1819
1828
  headers: __spreadValues({
1820
1829
  "Content-Type": "multipart/form-data"