mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 11:16:31 -05:00
refactor(media-upload): explicitly use public note ID
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
2c1e0517ff
commit
2689f9f3dc
2 changed files with 3 additions and 3 deletions
|
@ -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.
|
||||
|
|
|
@ -225,7 +225,7 @@ export class MediaService {
|
|||
async toMediaUploadDto(mediaUpload: MediaUpload): Promise<MediaUploadDto> {
|
||||
return {
|
||||
url: mediaUpload.fileUrl,
|
||||
noteId: (await mediaUpload.note)?.id ?? null,
|
||||
notePublicId: (await mediaUpload.note)?.publicId ?? null,
|
||||
createdAt: mediaUpload.createdAt,
|
||||
username: (await mediaUpload.user).username,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue