Add modulos de usuario
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsIn, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
|
||||
|
||||
export class PaginatedQueryDto {
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
page: number = 1;
|
||||
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(100)
|
||||
perPage: number = 20;
|
||||
|
||||
@IsOptional()
|
||||
@Type(() => String)
|
||||
@IsString()
|
||||
@IsIn(['asc', 'desc'])
|
||||
direction: string = 'desc';
|
||||
}
|
||||
|
||||
export type PaginatedResponse<T> = {
|
||||
content: T[];
|
||||
pagination: {
|
||||
page: number;
|
||||
direction: string;
|
||||
perPage: number;
|
||||
total: number;
|
||||
totalPages: number;
|
||||
hasNext: boolean;
|
||||
hasPrev: boolean;
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user