Add update-DTOs for note permissions and permission entries.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-07-26 20:58:40 +02:00
parent 11f6358516
commit 0d4c489aa5
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -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'; import { UserInfoDto } from '../users/user-info.dto';
export class NotePermissionEntryDto { export class NotePermissionEntryDto {
@ -8,6 +8,13 @@ export class NotePermissionEntryDto {
canEdit: boolean; canEdit: boolean;
} }
export class NotePermissionEntryUpdateDto {
@IsString()
username: string;
@IsBoolean()
canEdit: boolean;
}
export class NotePermissionsDto { export class NotePermissionsDto {
@ValidateNested() @ValidateNested()
owner: UserInfoDto; owner: UserInfoDto;
@ -15,3 +22,9 @@ export class NotePermissionsDto {
@IsArray() @IsArray()
sharedTo: NotePermissionEntryDto[]; sharedTo: NotePermissionEntryDto[];
} }
export class NotePermissionsUpdateDto {
@IsArray()
@ValidateNested()
sharedTo: NotePermissionEntryUpdateDto[];
}