mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-30 06:45:47 -04: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;
|
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?
|
* @example "noteId" TODO how looks a note id?
|
||||||
*/
|
*/
|
||||||
@IsString()
|
@IsString()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
noteId: string | null;
|
notePublicId: string | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The date when the upload objects was created.
|
* The date when the upload objects was created.
|
||||||
|
|
|
@ -225,7 +225,7 @@ export class MediaService {
|
||||||
async toMediaUploadDto(mediaUpload: MediaUpload): Promise<MediaUploadDto> {
|
async toMediaUploadDto(mediaUpload: MediaUpload): Promise<MediaUploadDto> {
|
||||||
return {
|
return {
|
||||||
url: mediaUpload.fileUrl,
|
url: mediaUpload.fileUrl,
|
||||||
noteId: (await mediaUpload.note)?.id ?? null,
|
notePublicId: (await mediaUpload.note)?.publicId ?? null,
|
||||||
createdAt: mediaUpload.createdAt,
|
createdAt: mediaUpload.createdAt,
|
||||||
username: (await mediaUpload.user).username,
|
username: (await mediaUpload.user).username,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue