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"); }