From 8da6d62cea79e3ed94e56aee48b500db283ff6f0 Mon Sep 17 00:00:00 2001 From: "Joaquin \"Florius\" Azcarate" Date: Sat, 2 Apr 2022 00:52:08 +0200 Subject: [PATCH] Destoy files when destroying post (#62) --- server/src/routes/posts.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/routes/posts.ts b/server/src/routes/posts.ts index 9ec882b..1b6d761 100644 --- a/server/src/routes/posts.ts +++ b/server/src/routes/posts.ts @@ -299,6 +299,11 @@ posts.delete("/:id", jwt, async (req: UserJwtRequest, res, next) => { model: User, as: "users", attributes: ["id"] + }, + { + model: File, + as: "files", + attributes: ["id"] } ] })