MediaUploadDto: Make noteId optional

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-04-29 16:59:40 +02:00
parent b518583fd2
commit 64f9a29f02
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
2 changed files with 2 additions and 2 deletions

View file

@ -23,7 +23,7 @@ export class MediaUploadDto {
@IsString()
@IsOptional()
@ApiProperty()
noteId?: string;
noteId: string | null;
/**
* The date when the upload objects was created.

View file

@ -227,7 +227,7 @@ export class MediaService {
toMediaUploadDto(mediaUpload: MediaUpload): MediaUploadDto {
return {
url: mediaUpload.fileUrl,
noteId: mediaUpload.note?.id,
noteId: mediaUpload.note?.id ?? null,
createdAt: mediaUpload.createdAt,
userName: mediaUpload.user.userName,
};