From 5dc68eed026d531d191a6574e542674b7a4715bf Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Fri, 23 Oct 2020 01:04:20 +0300 Subject: [PATCH] Fix sending actor type filters --- src/api/users.js | 9 ++++++++- src/views/users/components/UsersFilter.vue | 18 +++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/api/users.js b/src/api/users.js index 7b275e18..8e61ea30 100644 --- a/src/api/users.js +++ b/src/api/users.js @@ -111,9 +111,16 @@ export async function fetchUser(id, authHost, token) { } export async function fetchUsers(filters, actorTypeFilters, authHost, token, page = 1) { + const url = actorTypeFilters.length === 0 + ? `/api/pleroma/admin/users?page=${page}&filters=${filters}` + : actorTypeFilters.reduce((acc, filter) => { + const newAcc = acc.concat(`&actor_types[]=${filter}`) + return newAcc + }, `/api/pleroma/admin/users?page=${page}&filters=${filters}`) + return await request({ baseURL: baseName(authHost), - url: `/api/pleroma/admin/users?page=${page}&filters=${filters}&actor_types=${actorTypeFilters}`, + url, method: 'get', headers: authHeaders(token) }) diff --git a/src/views/users/components/UsersFilter.vue b/src/views/users/components/UsersFilter.vue index 379577d7..f624a508 100644 --- a/src/views/users/components/UsersFilter.vue +++ b/src/views/users/components/UsersFilter.vue @@ -7,19 +7,19 @@ class="select-field" @change="toggleFilters"> - {{ $t('usersFilter.local') }} - {{ $t('usersFilter.external') }} + + - {{ $t('usersFilter.active') }} - {{ $t('usersFilter.deactivated') }} - {{ $t('usersFilter.pending') }} - {{ $t('usersFilter.unconfirmed') }} + + + + - {{ $t('usersFilter.person') }} - {{ $t('usersFilter.bot') }} - {{ $t('usersFilter.application') }} + + +