forked from AkkomaGang/admin-fe
Use actor type filters with search query
This commit is contained in:
parent
ff8a68e720
commit
fff34e817a
1 changed files with 8 additions and 1 deletions
|
@ -183,9 +183,16 @@ export async function resendConfirmationEmail(nicknames, authHost, token) {
|
|||
}
|
||||
|
||||
export async function searchUsers(query, filters, actorTypeFilters, authHost, token, page = 1) {
|
||||
const url = actorTypeFilters.length === 0
|
||||
? `/api/pleroma/admin/users?query=${query}&page=${page}&filters=${filters}`
|
||||
: actorTypeFilters.reduce((acc, filter) => {
|
||||
const newAcc = acc.concat(`&actor_types[]=${filter}`)
|
||||
return newAcc
|
||||
}, `/api/pleroma/admin/users?query=${query}&page=${page}&filters=${filters}`)
|
||||
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users?query=${query}&page=${page}&filters=${filters}&actor_types=${actorTypeFilters}`,
|
||||
url,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue