mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-16 16:14:43 -04: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()
|
@IsString()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@ApiPropertyOptional()
|
@ApiPropertyOptional()
|
||||||
alias: string;
|
alias?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Title of the note
|
* Title of the note
|
||||||
|
@ -72,8 +72,9 @@ export class NoteMetadataDto {
|
||||||
* User that last edited the note
|
* User that last edited the note
|
||||||
*/
|
*/
|
||||||
@ValidateNested()
|
@ValidateNested()
|
||||||
@ApiProperty({ type: UserInfoDto })
|
@ApiPropertyOptional({ type: UserInfoDto })
|
||||||
updateUser: UserInfoDto;
|
@IsOptional()
|
||||||
|
updateUser?: UserInfoDto;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Counts how many times the published note has been viewed
|
* Counts how many times the published note has been viewed
|
||||||
|
|
|
@ -4,10 +4,16 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* 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 { UserInfoDto } from '../users/user-info.dto';
|
||||||
import { GroupInfoDto } from '../groups/group-info.dto';
|
import { GroupInfoDto } from '../groups/group-info.dto';
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||||
|
|
||||||
export class NoteUserPermissionEntryDto {
|
export class NoteUserPermissionEntryDto {
|
||||||
/**
|
/**
|
||||||
|
@ -84,8 +90,9 @@ export class NotePermissionsDto {
|
||||||
* User this permission applies to
|
* User this permission applies to
|
||||||
*/
|
*/
|
||||||
@ValidateNested()
|
@ValidateNested()
|
||||||
@ApiProperty({ type: UserInfoDto })
|
@ApiPropertyOptional({ type: UserInfoDto })
|
||||||
owner: UserInfoDto;
|
@IsOptional()
|
||||||
|
owner?: UserInfoDto;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of users the note is shared with
|
* List of users the note is shared with
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue