mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-23 10:16:32 -05:00
MediaUploadDto: Make noteId optional
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
dc7d8ab470
commit
b08a314863
2 changed files with 4 additions and 3 deletions
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { IsDate, IsString } from 'class-validator';
|
import { IsDate, IsOptional, IsString } from 'class-validator';
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
|
|
||||||
export class MediaUploadDto {
|
export class MediaUploadDto {
|
||||||
|
@ -21,8 +21,9 @@ export class MediaUploadDto {
|
||||||
* @example "noteId" TODO how looks a note id?
|
* @example "noteId" TODO how looks a note id?
|
||||||
*/
|
*/
|
||||||
@IsString()
|
@IsString()
|
||||||
|
@IsOptional()
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
noteId: string;
|
noteId?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The date when the upload objects was created.
|
* The date when the upload objects was created.
|
||||||
|
|
|
@ -227,7 +227,7 @@ export class MediaService {
|
||||||
toMediaUploadDto(mediaUpload: MediaUpload): MediaUploadDto {
|
toMediaUploadDto(mediaUpload: MediaUpload): MediaUploadDto {
|
||||||
return {
|
return {
|
||||||
url: mediaUpload.fileUrl,
|
url: mediaUpload.fileUrl,
|
||||||
noteId: mediaUpload.note.id,
|
noteId: mediaUpload.note?.id,
|
||||||
createdAt: mediaUpload.createdAt,
|
createdAt: mediaUpload.createdAt,
|
||||||
userName: mediaUpload.user.userName,
|
userName: mediaUpload.user.userName,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue