diff options
author | poeti8 <ezzati.upt@gmail.com> | 2020-02-07 18:43:19 +0300 |
---|---|---|
committer | poeti8 <ezzati.upt@gmail.com> | 2020-02-07 18:43:19 +0300 |
commit | dd510e3050bd527d4cdd44c967b9a387225eafc8 (patch) | |
tree | 96082808cdc473296a31beca064b98ff712dd289 /server | |
parent | a337a6bff0950e37eff8c15074367d9f4088b563 (diff) |
fix: only ban if has user_id
Diffstat (limited to 'server')
-rw-r--r-- | server/handlers/links.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/handlers/links.ts b/server/handlers/links.ts index e681007..cf2349d 100644 --- a/server/handlers/links.ts +++ b/server/handlers/links.ts @@ -173,12 +173,12 @@ export const ban: Handler = async (req, res) => { } // 5. Ban link owner - if (req.body.user) { + if (req.body.user && link.user_id) { tasks.push(query.user.update({ id: link.user_id }, update)); } // 6. Ban all of owner's links - if (req.body.userLinks) { + if (req.body.userLinks && link.user_id) { tasks.push(query.link.update({ user_id: link.user_id }, update)); } |