diff options
author | Chocobozzz <me@florianbigard.com> | 2020-05-07 14:58:24 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-05-07 15:07:01 +0200 |
commit | 80fdaf064562aff968f4c9cea1cf220bc12a70da (patch) | |
tree | a0ec49f433b828660f741b394dfd87056cd2c6ef /server/middlewares/validators | |
parent | 3cc665f48fd233d09f778d7e887488dde6f03ef6 (diff) | |
download | PeerTube-80fdaf064562aff968f4c9cea1cf220bc12a70da.tar.gz PeerTube-80fdaf064562aff968f4c9cea1cf220bc12a70da.tar.zst PeerTube-80fdaf064562aff968f4c9cea1cf220bc12a70da.zip |
Add moderation helpers to plugins
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r-- | server/middlewares/validators/blocklist.ts | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/server/middlewares/validators/blocklist.ts b/server/middlewares/validators/blocklist.ts index c00a7e4df..27224ff9b 100644 --- a/server/middlewares/validators/blocklist.ts +++ b/server/middlewares/validators/blocklist.ts | |||
@@ -84,10 +84,7 @@ const blockServerValidator = [ | |||
84 | .end() | 84 | .end() |
85 | } | 85 | } |
86 | 86 | ||
87 | let server = await ServerModel.loadByHost(host) | 87 | const server = await ServerModel.loadOrCreateByHost(host) |
88 | if (!server) { | ||
89 | server = await ServerModel.create({ host }) | ||
90 | } | ||
91 | 88 | ||
92 | res.locals.server = server | 89 | res.locals.server = server |
93 | 90 | ||