Destoy files when destroying post (#62)

This commit is contained in:
Joaquin "Florius" Azcarate 2022-04-02 00:52:08 +02:00 committed by GitHub
parent 6a6a2a3496
commit 8da6d62cea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"]
}
]
})