Skip to content

Commit

Permalink
fix: convert page query param to number (#433)
Browse files Browse the repository at this point in the history
* fix: convert page query param to number

Co-authored-by: Florimond Manca <[email protected]>

---------

Co-authored-by: Florimond Manca <[email protected]>
  • Loading branch information
ip512 and florimondmanca authored May 30, 2024
1 parent dd46fcd commit de0a20a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Infrastructure/Common/DTO/PaginationDTO.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Transform, Type } from 'class-transformer';
import { IsNumber, IsOptional, Max, Min } from 'class-validator';

export class PaginationDTO {
@IsOptional()
@Min(1)
@Max(10000)
@IsNumber()
@Transform((_, { page }) => +page)
public page = 1;
}

0 comments on commit de0a20a

Please sign in to comment.