Skip to content

Commit 6434681

Browse files
committed
feat: update PageQueryDTO to use 'query' for filtering and add UserQuery DTO for user-specific queries
1 parent 22378f2 commit 6434681

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

shared/validation/common/dto/PageQuery.dto.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ export class PageQueryDTO {
6767
@IsString()
6868
@IsOptional()
6969
@ApiProperty({
70-
example: 'Bentroen',
71-
description: 'Filters results uploaded by a specific user (by username).',
70+
examples: ['Bentroen', 'Tomast1337', 'Slayer - Raining Blood'],
71+
description:
72+
'Filters results uploaded by a string matching the specified query.',
7273
required: false,
7374
})
74-
user?: string;
75+
query?: string;
7576

7677
constructor(partial: Partial<PageQueryDTO>) {
7778
Object.assign(this, partial);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { PartialType } from '@nestjs/mapped-types';
2+
import { IsBoolean, IsOptional } from 'class-validator';
3+
4+
import { PageQueryDTO } from '@shared/validation/common/dto/PageQuery.dto';
5+
6+
export class UserQuery extends PartialType(PageQueryDTO) {
7+
@IsBoolean()
8+
@IsOptional()
9+
me?: boolean;
10+
}

0 commit comments

Comments
 (0)