File

src/user/dtos/top-users.dto.ts

Index

Properties
Accessors

Properties

Readonly Optional limit
Type : number
Default value : 50
Decorators :
@ApiPropertyOptional({minimum: 1, maximum: 1000, default: 10, type: 'integer'})
@Type(undefined)
@IsInt()
@Min(1)
@Max(10000)
@IsOptional()
Readonly Optional page
Type : number
Default value : 1
Decorators :
@ApiPropertyOptional({minimum: 1, default: 1, type: 'integer'})
@Type(undefined)
@IsInt()
@Min(1)
@IsOptional()
Readonly Optional userId
Type : number
Default value : 0
Decorators :
@ApiPropertyOptional({description: 'User ID to filter followings from the list', type: 'integer'})
@IsOptional()
@Type(undefined)

Accessors

skip
getskip()
import { ApiPropertyOptional } from "@nestjs/swagger";
import { Type } from "class-transformer";
import { IsInt, Min, IsOptional, Max } from "class-validator";

export class TopUsersDto {
  @ApiPropertyOptional({
    minimum: 1,
    default: 1,
    type: "integer",
  })
  @Type(() => Number)
  @IsInt()
  @Min(1)
  @IsOptional()
  readonly page?: number = 1;

  @ApiPropertyOptional({
    description: "User ID to filter followings from the list",
    type: "integer",
  })
  @IsOptional()
  @Type(() => Number)
  readonly userId?: number = 0;

  @ApiPropertyOptional({
    minimum: 1,
    maximum: 1000,
    default: 10,
    type: "integer",
  })
  @Type(() => Number)
  @IsInt()
  @Min(1)
  @Max(10000)
  @IsOptional()
  readonly limit?: number = 50;

  get skip(): number {
    return ((this.page ?? 1) - 1) * (this.limit ?? 50);
  }
}

results matching ""

    No results matching ""