@longvansoftware/storefront-js-client 4.1.9 → 4.2.0

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.
@@ -27,4 +27,5 @@ export declare class PortalService extends Service {
27
27
  bookingSchedule(data: Record<string, any>): Promise<any>;
28
28
  getWorkSchedule(orgId: string, query?: Record<string, any>): Promise<any>;
29
29
  updateSchedule(orgId: string, data: Record<string, any>): Promise<any>;
30
+ getPosition(query?: Record<string, any>): Promise<any>;
30
31
  }
@@ -369,7 +369,7 @@ class PortalService extends serviceSDK_1.Service {
369
369
  }
370
370
  updateSchedule(orgId, data) {
371
371
  return __awaiter(this, void 0, void 0, function* () {
372
- const method = 'POST';
372
+ const method = "POST";
373
373
  const endpoint = `/dynamic-collection/public/v2/schedule/actionBooking`;
374
374
  try {
375
375
  const response = yield this.restApiCallWithNoToken(endpoint, method, data);
@@ -380,5 +380,29 @@ class PortalService extends serviceSDK_1.Service {
380
380
  }
381
381
  });
382
382
  }
383
+ getPosition(query) {
384
+ return __awaiter(this, void 0, void 0, function* () {
385
+ const method = "GET";
386
+ const baseUrl = `/dynamic-collection/public/v2/records/POSITION/danh_sach_vi_tri`;
387
+ const params = new URLSearchParams();
388
+ if (query) {
389
+ Object.entries(query).forEach(([key, value]) => {
390
+ if (value !== undefined && value !== null) {
391
+ params.append(key, String(value));
392
+ }
393
+ });
394
+ }
395
+ const endpoint = params.toString()
396
+ ? `${baseUrl}?${params.toString()}`
397
+ : baseUrl;
398
+ try {
399
+ const response = yield this.restApiCallWithNoToken(endpoint, method);
400
+ return response;
401
+ }
402
+ catch (error) {
403
+ throw error;
404
+ }
405
+ });
406
+ }
383
407
  }
384
408
  exports.PortalService = PortalService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "4.1.9",
3
+ "version": "4.2.0",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [