mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-24 18:56:32 -05:00
Add update-DTOs for note permissions and permission entries.
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
11f6358516
commit
0d4c489aa5
1 changed files with 14 additions and 1 deletions
|
@ -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[];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue