Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thedevs-network/kutt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorpoeti8 <ezzati.upt@gmail.com>2020-02-07 18:43:19 +0300
committerpoeti8 <ezzati.upt@gmail.com>2020-02-07 18:43:19 +0300
commitdd510e3050bd527d4cdd44c967b9a387225eafc8 (patch)
tree96082808cdc473296a31beca064b98ff712dd289 /server
parenta337a6bff0950e37eff8c15074367d9f4088b563 (diff)
fix: only ban if has user_id
Diffstat (limited to 'server')
-rw-r--r--server/handlers/links.ts4
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));
}