fix(media-upload): remove backendData parameter

`Create` methods should only contain optional properties

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-11-14 21:14:03 +01:00
parent a08d8c58ed
commit 9258863dbd
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
2 changed files with 2 additions and 3 deletions

View file

@ -68,7 +68,6 @@ export class MediaUpload {
user: User,
extension: string,
backendType: BackendType,
backendData: BackendData | null,
fileUrl: string,
): Omit<MediaUpload, 'createdAt'> {
const upload = new MediaUpload();
@ -76,7 +75,7 @@ export class MediaUpload {
upload.note = note;
upload.user = user;
upload.backendType = backendType;
upload.backendData = backendData;
upload.backendData = null;
upload.fileUrl = fileUrl;
return upload;
}

View file

@ -99,9 +99,9 @@ export class MediaService {
user,
fileTypeResult.ext,
this.mediaBackendType,
backendData,
url,
);
mediaUpload.backendData = backendData;
await this.mediaUploadRepository.save(mediaUpload);
return url;
}