diff --git a/src/notes/note-metadata.dto.ts b/src/notes/note-metadata.dto.ts index 03f23011e..f23972eec 100644 --- a/src/notes/note-metadata.dto.ts +++ b/src/notes/note-metadata.dto.ts @@ -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 diff --git a/src/notes/note-permissions.dto.ts b/src/notes/note-permissions.dto.ts index 11c7d3c62..829732ee3 100644 --- a/src/notes/note-permissions.dto.ts +++ b/src/notes/note-permissions.dto.ts @@ -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