diff --git a/src/api/users.js b/src/api/users.js index 8e61ea30..d45aa701 100644 --- a/src/api/users.js +++ b/src/api/users.js @@ -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) })