aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/follows.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/follows.ts')
-rw-r--r--server/middlewares/validators/follows.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/middlewares/validators/follows.ts b/server/middlewares/validators/follows.ts
index dfd6e7f03..ddc4c1de1 100644
--- a/server/middlewares/validators/follows.ts
+++ b/server/middlewares/validators/follows.ts
@@ -31,19 +31,19 @@ const removeFollowingValidator = [
31 param('accountId').custom(isIdOrUUIDValid).withMessage('Should have a valid account id'), 31 param('accountId').custom(isIdOrUUIDValid).withMessage('Should have a valid account id'),
32 32
33 (req: express.Request, res: express.Response, next: express.NextFunction) => { 33 (req: express.Request, res: express.Response, next: express.NextFunction) => {
34 logger.debug('Checking follow parameters', { parameters: req.body }) 34 logger.debug('Checking unfollow parameters', { parameters: req.params })
35 35
36 checkErrors(req, res, async () => { 36 checkErrors(req, res, async () => {
37 try { 37 try {
38 const serverAccount = await getServerAccount() 38 const serverAccount = await getServerAccount()
39 const following = await db.AccountFollow.loadByAccountAndTarget(serverAccount.id, req.params.accountId) 39 const follow = await db.AccountFollow.loadByAccountAndTarget(serverAccount.id, req.params.accountId)
40 40
41 if (!following) { 41 if (!follow) {
42 return res.status(404) 42 return res.status(404)
43 .end() 43 .end()
44 } 44 }
45 45
46 res.locals.following = following 46 res.locals.follow = follow
47 47
48 return next() 48 return next()
49 } catch (err) { 49 } catch (err) {