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

View file

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