@longvansoftware/storefront-js-client 4.1.9 → 4.2.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.
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Service } from "../serviceSDK";
|
|
2
2
|
export declare class CloudCloudService extends Service {
|
|
3
3
|
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
-
setToken(token: string): void;
|
|
5
4
|
searchService(data: any): Promise<any>;
|
|
6
5
|
serviceDetail(serviceId: string): Promise<any>;
|
|
7
6
|
}
|
|
@@ -16,9 +16,6 @@ class CloudCloudService extends serviceSDK_1.Service {
|
|
|
16
16
|
constructor(endpoint, orgId, storeId) {
|
|
17
17
|
super(endpoint, orgId, storeId);
|
|
18
18
|
}
|
|
19
|
-
setToken(token) {
|
|
20
|
-
this.token = token;
|
|
21
|
-
}
|
|
22
19
|
searchService(data) {
|
|
23
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
21
|
const query = queries_1.SEARCH_SERVICE;
|
|
@@ -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 =
|
|
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;
|