credebl / platform

Open source, Open standards based Decentralised Identity & Verifiable Credentials Platform
Apache License 2.0
33 stars 16 forks source link

refactor: Implement use of Pagination DTO #705

Open GHkrishna opened 6 months ago

GHkrishna commented 6 months ago

About

Current behavior

Expected behavior

Instead a better way would be to extend and make use of the already existing PaginationDto. So the above implementation would become something like:

export class GetAllConnectionsDto extends PaginationDto {
  @ApiProperty({
    required: false
  })
  @Transform(({ value }) => trim(value))
  @IsOptional()
  @IsEnum(SortFields)
  sortField: string = SortFields.CREATED_DATE_TIME;

  @ApiProperty({
    enum: [SortValue.DESC, SortValue.ASC],
    required: false
  })
  @Transform(({ value }) => trim(value))
  @IsOptional()
  @IsEnum(SortValue)
  sortBy: string = SortValue.DESC;
} 

Note

snufkinwa commented 3 days ago

Hi, I'd like to contribute to this issue if it's still available.

GHkrishna commented 1 day ago

Hello @snufkinwa Yes sure, the issue is still open. You can create a draft PR and continue adding to it.

snufkinwa commented 1 day ago

Will do!