mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-28 15:31:11 -04:00
[api] minor request validator to avoid spamming logs on invalid requests
This commit is contained in:
parent
f85f62ced2
commit
fa0a181117
@ -563,6 +563,10 @@ router.post('/profile/save', handleErrorAsync(async (req, res) => {
|
||||
}));
|
||||
|
||||
router.post('/profile/delete/:locale', handleErrorAsync(async (req, res) => {
|
||||
if (!req.user) {
|
||||
return res.status(400).json({error: 'Missing user'});
|
||||
}
|
||||
|
||||
await req.db.get(SQL`DELETE FROM profiles WHERE userId = ${req.user.id} AND locale = ${req.params.locale}`);
|
||||
|
||||
return res.json(await fetchProfiles(req.db, req.user.username, true));
|
||||
|
Loading…
x
Reference in New Issue
Block a user