@bzbs/react-api-client 0.1.4 → 0.1.6

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
@@ -1329,6 +1329,7 @@ var PointLogApi = class extends BaseService {
1329
1329
  };
1330
1330
 
1331
1331
  // src/api/profile/profile-api.ts
1332
+ import { FormData } from "undici-types";
1332
1333
  var ProfileApi = class extends BaseService {
1333
1334
  constructor(client, baseUrl) {
1334
1335
  super(client, baseUrl);
@@ -1353,66 +1354,25 @@ var ProfileApi = class extends BaseService {
1353
1354
  */
1354
1355
  updateProfile(params, requestOptions) {
1355
1356
  return __async(this, null, function* () {
1356
- return yield this.post(
1357
- "profile/me",
1358
- __spreadValues({
1359
- data: params.profileImage,
1360
- firstname: params.firstName,
1361
- lastname: params.lastName,
1362
- contact_number: params.contactNumber,
1363
- email: params.email,
1364
- notification: params.notification,
1365
- locale: params.locale,
1366
- title: params.title,
1367
- gender: params.gender,
1368
- birthdate: params.birthDate,
1369
- address: params.address,
1370
- subdistrict_code: params.subdistrictCode,
1371
- subdistrict_name: params.subdistrictName,
1372
- district_code: params.districtCode,
1373
- district_name: params.districtName,
1374
- province_code: params.provinceCode,
1375
- province_name: params.provinceName,
1376
- country_code: params.countryCode,
1377
- country_name: params.countryName,
1378
- Zipcode: params.zipCode,
1379
- idCard: params.idCard,
1380
- passport: params.passport,
1381
- maritalstatus: params.maritalStatus,
1382
- village: params.village,
1383
- building: params.building,
1384
- number: params.number,
1385
- moo: params.moo,
1386
- room: params.room,
1387
- floor: params.floor,
1388
- soi: params.soi,
1389
- city: params.city,
1390
- road: params.road,
1391
- landmark: params.landmark,
1392
- alternate_contact_number: params.alternateContactNumber,
1393
- home_contact_number: params.homeContactNumber,
1394
- nationality: params.nationality,
1395
- religion: params.religion,
1396
- location: params.location,
1397
- latitude: params.latitude,
1398
- longitude: params.longitude,
1399
- income: params.income,
1400
- interests: params.interests,
1401
- region: params.region,
1402
- phonepurchase: params.phonepurchase,
1403
- highesteducation: params.highestEducation,
1404
- occupation: params.occupation,
1405
- remark: params.remark,
1406
- displayname: params.displayName
1407
- }, params.options),
1408
- {
1409
- headers: __spreadValues({
1410
- "Content-Type": "multipart/form-data"
1411
- }, (requestOptions == null ? void 0 : requestOptions.headers) ? requestOptions.headers : {}),
1412
- params: requestOptions == null ? void 0 : requestOptions.params,
1413
- data: requestOptions == null ? void 0 : requestOptions.data
1357
+ const formData = new FormData();
1358
+ if (params.profileImage) {
1359
+ if (typeof window !== "undefined") {
1360
+ formData.append("data", params.profileImage);
1361
+ } else {
1362
+ const { uri, name, type } = params.profileImage;
1363
+ formData.append("data", { uri, name, type });
1414
1364
  }
1415
- );
1365
+ }
1366
+ Object.keys(params).forEach((key) => {
1367
+ if (key !== "profileImage" && params[key] !== void 0) {
1368
+ formData.append(key, params[key]);
1369
+ }
1370
+ });
1371
+ return yield this.post("profile/me", formData, {
1372
+ headers: __spreadValues(__spreadValues({}, (requestOptions == null ? void 0 : requestOptions.headers) ? requestOptions.headers : {}), typeof window !== "undefined" ? { "Content-Type": "multipart/form-data" } : {}),
1373
+ params: requestOptions == null ? void 0 : requestOptions.params,
1374
+ data: requestOptions == null ? void 0 : requestOptions.data
1375
+ });
1416
1376
  });
1417
1377
  }
1418
1378
  /**