fix age
This commit is contained in:
parent
72b5f30fac
commit
c499e13c97
1 changed files with 12 additions and 12 deletions
|
|
@ -50,16 +50,16 @@ export class ReportController extends Controller {
|
|||
@Query() ageMin?: number,
|
||||
@Query() ageMax?: number,
|
||||
) {
|
||||
if (ageMin && (ageMin < 20 || ageMin > 80)) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ageMin must be between 20 and 80");
|
||||
if (ageMin && (ageMin < 18 || ageMin > 60)) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ageMin must be between 18 and 60");
|
||||
}
|
||||
|
||||
if (ageMax && (ageMax < 20 || ageMax > 80)) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ageMax must be between 20 and 80");
|
||||
if (ageMax && (ageMax < 18 || ageMax > 60)) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ageMax must be between 18 and 60");
|
||||
}
|
||||
|
||||
const minAge = ageMin ?? 20;
|
||||
const maxAge = ageMax ?? 80;
|
||||
const minAge = ageMin ?? 18;
|
||||
const maxAge = ageMax ?? 60;
|
||||
|
||||
if (minAge > maxAge) {
|
||||
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() ageMax?: number,
|
||||
) {
|
||||
if (ageMin && (ageMin < 20 || ageMin > 80)) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ageMin must be between 20 and 80");
|
||||
if (ageMin && (ageMin < 18 || ageMin > 60)) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ageMin must be between 18 and 60");
|
||||
}
|
||||
|
||||
if (ageMax && (ageMax < 20 || ageMax > 80)) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ageMax must be between 20 and 80");
|
||||
if (ageMax && (ageMax < 18 || ageMax > 60)) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ageMax must be between 18 and 60");
|
||||
}
|
||||
|
||||
const minAge = ageMin ?? 20;
|
||||
const maxAge = ageMax ?? 80;
|
||||
const minAge = ageMin ?? 18;
|
||||
const maxAge = ageMax ?? 60;
|
||||
|
||||
if (minAge > maxAge) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ageMin cannot be greater than ageMax");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue