From 64470b67a171f84f090bd937f805d2f0f2724478 Mon Sep 17 00:00:00 2001 From: Bright Date: Mon, 24 Feb 2025 11:50:52 +0700 Subject: [PATCH] no message --- src/controllers/ReportController.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 6ee53ccd..5ec3e5f3 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -191,6 +191,13 @@ export class ReportController extends Controller { @Query() sortBy: string = "posMasterNo", @Query() sort: "ASC" | "DESC" = "ASC", ) { + const _null: any = null; + if(!dateStart) { + dateStart = _null + } + if(!dateEnd) { + dateEnd = _null + } if (ageMin && (ageMin < 18 || ageMin > 60)) { throw new HttpError(HttpStatus.NOT_FOUND, "ageMin must be between 18 and 60"); } @@ -487,6 +494,13 @@ export class ReportController extends Controller { @Query() sortBy: string = "posMasterNo", @Query() sort: "ASC" | "DESC" = "ASC", ) { + const _null: any = null; + if(!dateStart) { + dateStart = _null + } + if(!dateEnd) { + dateEnd = _null + } if (ageMin && (ageMin < 18 || ageMin > 60)) { throw new HttpError(HttpStatus.NOT_FOUND, "ageMin must be between 18 and 60"); }