From 2689f9f3dca4587c1bc2671117f20a3155234130 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sun, 18 Sep 2022 20:38:50 +0200 Subject: [PATCH] refactor(media-upload): explicitly use public note ID Signed-off-by: David Mehren --- src/media/media-upload.dto.ts | 4 ++-- src/media/media.service.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/media/media-upload.dto.ts b/src/media/media-upload.dto.ts index d0d96eb73..690617009 100644 --- a/src/media/media-upload.dto.ts +++ b/src/media/media-upload.dto.ts @@ -19,13 +19,13 @@ export class MediaUploadDto extends BaseDto { url: string; /** - * The noteId of the note to which the uploaded file is linked to. + * The publicId of the note to which the uploaded file is linked to. * @example "noteId" TODO how looks a note id? */ @IsString() @IsOptional() @ApiProperty() - noteId: string | null; + notePublicId: string | null; /** * The date when the upload objects was created. diff --git a/src/media/media.service.ts b/src/media/media.service.ts index 812f2e8af..81aef875b 100644 --- a/src/media/media.service.ts +++ b/src/media/media.service.ts @@ -225,7 +225,7 @@ export class MediaService { async toMediaUploadDto(mediaUpload: MediaUpload): Promise { return { url: mediaUpload.fileUrl, - noteId: (await mediaUpload.note)?.id ?? null, + notePublicId: (await mediaUpload.note)?.publicId ?? null, createdAt: mediaUpload.createdAt, username: (await mediaUpload.user).username, };