@longvansoftware/storefront-js-client 3.6.4 → 3.6.5

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.
@@ -20,4 +20,6 @@ export declare class PortalService extends Service {
20
20
  completeCancelFFMOrder(orderId: string, note: string, reason: string): Promise<any>;
21
21
  saveTextEditor(saveTextEditor: any): Promise<any>;
22
22
  getContent(type: string, relativeId: string): Promise<any>;
23
+ getCalendarStudent(studentId?: string, classId?: string, startDate?: number, endDate?: number): Promise<any>;
24
+ getClass(): Promise<any>;
23
25
  }
@@ -251,5 +251,43 @@ class PortalService extends serviceSDK_1.Service {
251
251
  }
252
252
  });
253
253
  }
254
+ getCalendarStudent(studentId, classId, startDate, endDate) {
255
+ return __awaiter(this, void 0, void 0, function* () {
256
+ const method = "GET";
257
+ // Gom tất cả tham số vào object
258
+ const params = {
259
+ studentId,
260
+ classId,
261
+ startDate,
262
+ endDate,
263
+ };
264
+ // Lọc ra những tham số có giá trị
265
+ const query = Object.entries(params)
266
+ .filter(([_, value]) => value !== undefined && value !== null && value !== "")
267
+ .map(([key, value]) => `${key}=${encodeURIComponent(value)}`)
268
+ .join("&");
269
+ const endpoint = `/dynamic-collection/public/v2/schedule/lesson/${this.orgId}${query ? `?${query}` : ""}`;
270
+ try {
271
+ const response = yield this.restApiCallWithNoToken(endpoint, method);
272
+ return response;
273
+ }
274
+ catch (error) {
275
+ throw error;
276
+ }
277
+ });
278
+ }
279
+ getClass() {
280
+ return __awaiter(this, void 0, void 0, function* () {
281
+ const method = "GET";
282
+ const endpoint = `/dynamic-collection/public/v2/schedule/classSection/${this.orgId}`;
283
+ try {
284
+ const response = yield this.restApiCallWithNoToken(endpoint, method);
285
+ return response;
286
+ }
287
+ catch (error) {
288
+ throw error;
289
+ }
290
+ });
291
+ }
254
292
  }
255
293
  exports.PortalService = PortalService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "3.6.4",
3
+ "version": "3.6.5",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [