fix(notification): accept optional type query param to fix 400 error

Backend entity has no type column yet; whitelist the type field in DTO
so forbidNonWhitelisted doesn't reject requests from the mobile app.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-07 11:50:35 -08:00
parent af7fdfd428
commit c00c48c8bd
1 changed files with 6 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import { IsOptional, IsInt, Min, Max } from 'class-validator'; import { IsOptional, IsInt, IsString, Min, Max } from 'class-validator';
import { Type } from 'class-transformer'; import { Type } from 'class-transformer';
import { ApiPropertyOptional } from '@nestjs/swagger'; import { ApiPropertyOptional } from '@nestjs/swagger';
@ -17,4 +17,9 @@ export class NotificationQueryDto {
@Min(1) @Min(1)
@Max(100) @Max(100)
limit?: number = 20; limit?: number = 20;
@ApiPropertyOptional({ description: 'Filter by notification type (e.g. SYSTEM, ACTIVITY)' })
@IsOptional()
@IsString()
type?: string;
} }