fix(leaderboard-service): add @IsIn validator to UpdateLeaderboardSwitchDto
The 'type' field was missing validation decorator, causing 400 Bad Request when ValidationPipe with forbidNonWhitelisted was enabled. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
aa58b9e745
commit
8148f7a52a
|
|
@ -1,5 +1,5 @@
|
||||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||||
import { IsBoolean, IsInt, IsOptional, Min, Max } from 'class-validator';
|
import { IsBoolean, IsInt, IsOptional, IsIn, Min, Max } from 'class-validator';
|
||||||
import { Type } from 'class-transformer';
|
import { Type } from 'class-transformer';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -57,6 +57,7 @@ export class UpdateLeaderboardSwitchDto {
|
||||||
description: '榜单类型',
|
description: '榜单类型',
|
||||||
example: 'daily',
|
example: 'daily',
|
||||||
})
|
})
|
||||||
|
@IsIn(['daily', 'weekly', 'monthly'])
|
||||||
type: 'daily' | 'weekly' | 'monthly';
|
type: 'daily' | 'weekly' | 'monthly';
|
||||||
|
|
||||||
@ApiProperty({ description: '是否启用', example: true })
|
@ApiProperty({ description: '是否启用', example: true })
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue