forked from wangziqi/gongxue-base
fix(server): correct archive filters and deposit access
Parse archived class query flags without Boolean string coercion, register the refund approval permission, and grant dorm managers the deposit permission group.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { IsOptional, IsString, IsNotEmpty, IsInt, IsArray, IsDateString, IsEnum, ArrayNotEmpty, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { Type, Transform } from 'class-transformer';
|
||||
import { ClassType, ClassStatus, TeacherRoleType } from '../../entities';
|
||||
|
||||
export class CreateClassDto {
|
||||
@@ -98,7 +98,12 @@ export class QueryClassDto {
|
||||
keyword?: string;
|
||||
|
||||
@IsOptional()
|
||||
@Type(() => Boolean)
|
||||
@Transform(({ value }) => {
|
||||
if (typeof value === 'boolean') return value;
|
||||
if (value === 'true' || value === '1') return true;
|
||||
if (value === 'false' || value === '0') return false;
|
||||
return value;
|
||||
})
|
||||
isArchived?: boolean;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user