@longvansoftware/storefront-js-client 4.0.8 → 4.0.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.
|
@@ -23,4 +23,6 @@ export declare class PortalService extends Service {
|
|
|
23
23
|
getCalendarStudent(studentId?: string, classId?: string, startDate?: number, endDate?: number): Promise<any>;
|
|
24
24
|
getClass(studentId?: string): Promise<any>;
|
|
25
25
|
getMenus(menuId: string): Promise<any>;
|
|
26
|
+
getBooking(query?: Record<string, any>): Promise<any>;
|
|
27
|
+
bookingSchedule(data: Record<string, any>): Promise<void>;
|
|
26
28
|
}
|
|
@@ -306,5 +306,41 @@ class PortalService extends serviceSDK_1.Service {
|
|
|
306
306
|
}
|
|
307
307
|
});
|
|
308
308
|
}
|
|
309
|
+
getBooking(query) {
|
|
310
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
311
|
+
const method = "GET";
|
|
312
|
+
const baseUrl = `/dynamic-collection/public/v2/examination`;
|
|
313
|
+
const params = new URLSearchParams();
|
|
314
|
+
if (query) {
|
|
315
|
+
Object.entries(query).forEach(([key, value]) => {
|
|
316
|
+
if (value !== undefined && value !== null) {
|
|
317
|
+
params.append(key, String(value));
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
const endpoint = params.toString()
|
|
322
|
+
? `${baseUrl}?${params.toString()}`
|
|
323
|
+
: baseUrl;
|
|
324
|
+
try {
|
|
325
|
+
const response = yield this.restApiCallWithNoToken(endpoint, method);
|
|
326
|
+
return response;
|
|
327
|
+
}
|
|
328
|
+
catch (error) {
|
|
329
|
+
throw error;
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
bookingSchedule(data) {
|
|
334
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
335
|
+
const method = "POST";
|
|
336
|
+
const endpoint = `/dynamic-collection/public/v2/schedule/actionBooking`;
|
|
337
|
+
try {
|
|
338
|
+
const response = yield this.restApiCallWithNoToken(endpoint, method, data);
|
|
339
|
+
}
|
|
340
|
+
catch (error) {
|
|
341
|
+
throw error;
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
}
|
|
309
345
|
}
|
|
310
346
|
exports.PortalService = PortalService;
|