aboutsummaryrefslogtreecommitdiff
path: root/src/api/routes/admin/userEnable.js
diff options
context:
space:
mode:
authorPitu <[email protected]>2019-03-12 05:48:01 +0000
committerPitu <[email protected]>2019-03-12 05:48:01 +0000
commit197e69f2f2194df4ad23bb913c9efd39e1501b96 (patch)
tree336f3b45d9626c9b05700bbdcefb0d18168f270a /src/api/routes/admin/userEnable.js
parentNo more infinite loading if album is empty (diff)
downloadhost.fuwn.me-197e69f2f2194df4ad23bb913c9efd39e1501b96.tar.xz
host.fuwn.me-197e69f2f2194df4ad23bb913c9efd39e1501b96.zip
Prevent snowflakes from demoting/disabling themselves
Diffstat (limited to 'src/api/routes/admin/userEnable.js')
-rw-r--r--src/api/routes/admin/userEnable.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/api/routes/admin/userEnable.js b/src/api/routes/admin/userEnable.js
index 7e5743d..bdba7a6 100644
--- a/src/api/routes/admin/userEnable.js
+++ b/src/api/routes/admin/userEnable.js
@@ -9,6 +9,7 @@ class userEnable 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')