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:
2026-07-10 14:12:44 +08:00
parent 50b3608db4
commit b093d69f6a
2 changed files with 9 additions and 3 deletions

View File

@@ -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;
}