]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/blocklist.ts
Refactor follow/mute as modals in admin, add actions in abuse list
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / blocklist.ts
index 47a0b1a1c13135de8ca6db78e40df96e3a637d4d..b2183437c8bf60cf90aa14b7aa508f95dd11f382 100644 (file)
@@ -84,11 +84,9 @@ const blockServerValidator = [
         .end()
     }
 
-    const server = await ServerModel.loadByHost(host)
+    let server = await ServerModel.loadByHost(host)
     if (!server) {
-      return res.status(404)
-                .send({ error: 'Server host not found.' })
-                .end()
+      server = await ServerModel.create({ host })
     }
 
     res.locals.server = server