From e0a929179a9dc76e035ca7fda2b61d5ff46afbc5 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Sun, 19 Apr 2020 14:11:40 +0200 Subject: Add filter inputs for blacklisted videos and muted accounts/servers --- server/controllers/api/users/my-blocklist.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'server/controllers/api/users') diff --git a/server/controllers/api/users/my-blocklist.ts b/server/controllers/api/users/my-blocklist.ts index 713c16022..3a44376f2 100644 --- a/server/controllers/api/users/my-blocklist.ts +++ b/server/controllers/api/users/my-blocklist.ts @@ -74,7 +74,13 @@ export { async function listBlockedAccounts (req: express.Request, res: express.Response) { const user = res.locals.oauth.token.User - const resultList = await AccountBlocklistModel.listForApi(user.Account.id, req.query.start, req.query.count, req.query.sort) + const resultList = await AccountBlocklistModel.listForApi({ + start: req.query.start, + count: req.query.count, + sort: req.query.sort, + search: req.query.search, + accountId: user.Account.id + }) return res.json(getFormattedObjects(resultList.data, resultList.total)) } @@ -99,7 +105,13 @@ async function unblockAccount (req: express.Request, res: express.Response) { async function listBlockedServers (req: express.Request, res: express.Response) { const user = res.locals.oauth.token.User - const resultList = await ServerBlocklistModel.listForApi(user.Account.id, req.query.start, req.query.count, req.query.sort) + const resultList = await ServerBlocklistModel.listForApi({ + start: req.query.start, + count: req.query.count, + sort: req.query.sort, + search: req.query.search, + accountId: user.Account.id + }) return res.json(getFormattedObjects(resultList.data, resultList.total)) } -- cgit v1.2.3