fix: 🐛 body is not sent in delete requests requiring a parameter

Switches from using req.body to using req.params to know whether or not to delete their files
This commit is contained in:
linkability 2023-10-06 22:43:58 +01:00
parent d87583392e
commit 44133630a7
No known key found for this signature in database

View file

@ -142,7 +142,7 @@ module.exports = function(files: Files) {
}
)
router.delete("/me",
router.delete("/me/:deleteFiles",
requiresAccount,
noAPIAccess,
parser,
@ -157,7 +157,7 @@ module.exports = function(files: Files) {
const deleteAccount = () => Accounts.deleteAccount(accountId).then(_ => res.send("account deleted"))
if (req.body.deleteFiles) {
if (Boolean(req.params.deleteFiles)) {
const Files = Account.files.map(e => e)
for (let fileId of Files) {