From b014b6b9c7cb68d09c52b44046afe486c0736426 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 10 Oct 2018 09:43:53 +0200 Subject: Add ability to search on followers/following --- server/controllers/api/server/follows.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'server/controllers/api') diff --git a/server/controllers/api/server/follows.ts b/server/controllers/api/server/follows.ts index d62400e42..9fa6c34ba 100644 --- a/server/controllers/api/server/follows.ts +++ b/server/controllers/api/server/follows.ts @@ -61,14 +61,26 @@ export { async function listFollowing (req: express.Request, res: express.Response, next: express.NextFunction) { const serverActor = await getServerActor() - const resultList = await ActorFollowModel.listFollowingForApi(serverActor.id, req.query.start, req.query.count, req.query.sort) + const resultList = await ActorFollowModel.listFollowingForApi( + serverActor.id, + req.query.start, + req.query.count, + req.query.sort, + req.query.search + ) return res.json(getFormattedObjects(resultList.data, resultList.total)) } async function listFollowers (req: express.Request, res: express.Response, next: express.NextFunction) { const serverActor = await getServerActor() - const resultList = await ActorFollowModel.listFollowersForApi(serverActor.id, req.query.start, req.query.count, req.query.sort) + const resultList = await ActorFollowModel.listFollowersForApi( + serverActor.id, + req.query.start, + req.query.count, + req.query.sort, + req.query.search + ) return res.json(getFormattedObjects(resultList.data, resultList.total)) } -- cgit v1.2.3