Merge branch 'develop' of github.com:Frappet/hrms-api-org into develop

This commit is contained in:
kittapath 2024-12-13 16:06:31 +07:00
commit a5809663c4

View file

@ -50,16 +50,16 @@ export class ReportController extends Controller {
@Query() ageMin?: number, @Query() ageMin?: number,
@Query() ageMax?: number, @Query() ageMax?: number,
) { ) {
if (ageMin && (ageMin < 20 || ageMin > 80)) { if (ageMin && (ageMin < 18 || ageMin > 60)) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ageMin must be between 20 and 80"); throw new HttpError(HttpStatus.BAD_REQUEST, "ageMin must be between 18 and 60");
} }
if (ageMax && (ageMax < 20 || ageMax > 80)) { if (ageMax && (ageMax < 18 || ageMax > 60)) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ageMax must be between 20 and 80"); throw new HttpError(HttpStatus.BAD_REQUEST, "ageMax must be between 18 and 60");
} }
const minAge = ageMin ?? 20; const minAge = ageMin ?? 18;
const maxAge = ageMax ?? 80; const maxAge = ageMax ?? 60;
if (minAge > maxAge) { if (minAge > maxAge) {
throw new HttpError(HttpStatus.NOT_FOUND, "ageMin cannot be greater than ageMax"); throw new HttpError(HttpStatus.NOT_FOUND, "ageMin cannot be greater than ageMax");
@ -152,16 +152,16 @@ export class ReportController extends Controller {
@Query() ageMin?: number, @Query() ageMin?: number,
@Query() ageMax?: number, @Query() ageMax?: number,
) { ) {
if (ageMin && (ageMin < 20 || ageMin > 80)) { if (ageMin && (ageMin < 18 || ageMin > 60)) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ageMin must be between 20 and 80"); throw new HttpError(HttpStatus.BAD_REQUEST, "ageMin must be between 18 and 60");
} }
if (ageMax && (ageMax < 20 || ageMax > 80)) { if (ageMax && (ageMax < 18 || ageMax > 60)) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ageMax must be between 20 and 80"); throw new HttpError(HttpStatus.BAD_REQUEST, "ageMax must be between 18 and 60");
} }
const minAge = ageMin ?? 20; const minAge = ageMin ?? 18;
const maxAge = ageMax ?? 80; const maxAge = ageMax ?? 60;
if (minAge > maxAge) { if (minAge > maxAge) {
throw new HttpError(HttpStatus.NOT_FOUND, "ageMin cannot be greater than ageMax"); throw new HttpError(HttpStatus.NOT_FOUND, "ageMin cannot be greater than ageMax");