diff --git a/src/notes/note-permissions.dto.ts b/src/notes/note-permissions.dto.ts index 8e90f77dd..ad57c1a77 100644 --- a/src/notes/note-permissions.dto.ts +++ b/src/notes/note-permissions.dto.ts @@ -1,4 +1,4 @@ -import { IsArray, IsBoolean, ValidateNested } from 'class-validator'; +import { IsArray, IsBoolean, IsString, ValidateNested } from 'class-validator'; import { UserInfoDto } from '../users/user-info.dto'; export class NotePermissionEntryDto { @@ -8,6 +8,13 @@ export class NotePermissionEntryDto { canEdit: boolean; } +export class NotePermissionEntryUpdateDto { + @IsString() + username: string; + @IsBoolean() + canEdit: boolean; +} + export class NotePermissionsDto { @ValidateNested() owner: UserInfoDto; @@ -15,3 +22,9 @@ export class NotePermissionsDto { @IsArray() sharedTo: NotePermissionEntryDto[]; } + +export class NotePermissionsUpdateDto { + @IsArray() + @ValidateNested() + sharedTo: NotePermissionEntryUpdateDto[]; +}