mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-26 05:52:14 +00:00
Consistently type properties as optional
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
bc08493f89
commit
e217b30d26
2 changed files with 15 additions and 7 deletions
|
@ -31,7 +31,7 @@ export class NoteMetadataDto {
|
|||
@IsString()
|
||||
@IsOptional()
|
||||
@ApiPropertyOptional()
|
||||
alias: string;
|
||||
alias?: string;
|
||||
|
||||
/**
|
||||
* Title of the note
|
||||
|
@ -72,8 +72,9 @@ export class NoteMetadataDto {
|
|||
* User that last edited the note
|
||||
*/
|
||||
@ValidateNested()
|
||||
@ApiProperty({ type: UserInfoDto })
|
||||
updateUser: UserInfoDto;
|
||||
@ApiPropertyOptional({ type: UserInfoDto })
|
||||
@IsOptional()
|
||||
updateUser?: UserInfoDto;
|
||||
|
||||
/**
|
||||
* Counts how many times the published note has been viewed
|
||||
|
|
|
@ -4,10 +4,16 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { IsArray, IsBoolean, IsString, ValidateNested } from 'class-validator';
|
||||
import {
|
||||
IsArray,
|
||||
IsBoolean,
|
||||
IsOptional,
|
||||
IsString,
|
||||
ValidateNested,
|
||||
} from 'class-validator';
|
||||
import { UserInfoDto } from '../users/user-info.dto';
|
||||
import { GroupInfoDto } from '../groups/group-info.dto';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
|
||||
export class NoteUserPermissionEntryDto {
|
||||
/**
|
||||
|
@ -84,8 +90,9 @@ export class NotePermissionsDto {
|
|||
* User this permission applies to
|
||||
*/
|
||||
@ValidateNested()
|
||||
@ApiProperty({ type: UserInfoDto })
|
||||
owner: UserInfoDto;
|
||||
@ApiPropertyOptional({ type: UserInfoDto })
|
||||
@IsOptional()
|
||||
owner?: UserInfoDto;
|
||||
|
||||
/**
|
||||
* List of users the note is shared with
|
||||
|
|
Loading…
Reference in a new issue