Destoy files when destroying post (#62)
This commit is contained in:
parent
6a6a2a3496
commit
8da6d62cea
1 changed files with 5 additions and 0 deletions
|
@ -299,6 +299,11 @@ posts.delete("/:id", jwt, async (req: UserJwtRequest, res, next) => {
|
||||||
model: User,
|
model: User,
|
||||||
as: "users",
|
as: "users",
|
||||||
attributes: ["id"]
|
attributes: ["id"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
model: File,
|
||||||
|
as: "files",
|
||||||
|
attributes: ["id"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue