diff --git a/src/users/dto/create-user-settings.dto.ts b/src/users/dto/create-user-settings.dto.ts index 923d616bf..63095f1c2 100644 --- a/src/users/dto/create-user-settings.dto.ts +++ b/src/users/dto/create-user-settings.dto.ts @@ -1,7 +1,9 @@ import { ApiProperty } from "@nestjs/swagger"; import { UpdateUserSettingsDto } from "./update-user-settings.dto"; +import { IsString } from "class-validator"; export class CreateUserSettingsDto extends UpdateUserSettingsDto { @ApiProperty({ type: String, required: true }) + @IsString() readonly userId: string; } diff --git a/src/users/dto/update-user-settings.dto.ts b/src/users/dto/update-user-settings.dto.ts index 5aac97f77..8458e4e84 100644 --- a/src/users/dto/update-user-settings.dto.ts +++ b/src/users/dto/update-user-settings.dto.ts @@ -3,21 +3,27 @@ import { FilterConfig, ScientificCondition, } from "../schemas/user-settings.schema"; +import { IsArray, IsNumber } from "class-validator"; export class UpdateUserSettingsDto { @ApiProperty() + @IsArray() readonly columns: Record[]; @ApiProperty({ type: Number, required: false, default: 25 }) + @IsNumber() readonly datasetCount?: number; @ApiProperty({ type: Number, required: false, default: 25 }) + @IsNumber() readonly jobCount?: number; @ApiProperty() + @IsArray() readonly filters: FilterConfig[]; @ApiProperty() + @IsArray() readonly conditions: ScientificCondition[]; }