feat: Add guest file uploads and add deletion for note owners

Signed-off-by: Yannick Bungers <git@innay.de>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Yannick Bungers 2023-03-25 17:47:46 +01:00 committed by Yannick Bungers
parent 0f464dedfe
commit 485f7cd338
8 changed files with 244 additions and 68 deletions

View file

@ -28,9 +28,9 @@ export class MediaUpload {
note: Promise<Note | null>;
@ManyToOne((_) => User, (user) => user.mediaUploads, {
nullable: false,
nullable: true,
})
user: Promise<User>;
user: Promise<User | null>;
@Column({
nullable: false,
@ -65,7 +65,7 @@ export class MediaUpload {
public static create(
id: string,
note: Note,
user: User,
user: User | null,
extension: string,
backendType: BackendType,
fileUrl: string,