aboutsummaryrefslogtreecommitdiff
path: root/src/api/routes/admin/userDisable.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/routes/admin/userDisable.js')
-rw-r--r--src/api/routes/admin/userDisable.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/api/routes/admin/userDisable.js b/src/api/routes/admin/userDisable.js
index c7dffa8..65bcf4e 100644
--- a/src/api/routes/admin/userDisable.js
+++ b/src/api/routes/admin/userDisable.js
@@ -9,6 +9,7 @@ class userDisable extends Route {
if (!req.body) return res.status(400).json({ message: 'No body provided' });
const { id } = req.body;
if (!id) return res.status(400).json({ message: 'No id provided' });
+ if (id === user.id) return res.status(400).json({ message: 'You can\'t apply this action to yourself' });
try {
await db.table('users')