Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admins should be able to filter and sort users #709

Draft
wants to merge 10 commits into
base: develop
Choose a base branch
from
Prev Previous commit
Next Next commit
refactor: [#698] fixed duplicated requests
mario-nt committed Mar 19, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit e4a2b79b21b6eba6b7c63432d59da937aa2f9ac2
18 changes: 3 additions & 15 deletions pages/admin/settings/users.vue
Original file line number Diff line number Diff line change
@@ -83,20 +83,8 @@ const selectedSorting = computed({
}
});

watch(() => route.fullPath, () => {
searchQuery.value = route.query.search as string ?? null;
itemsSorting.value = route.query.sorting as string ?? sortingOptions[0].value;
currentPage.value = isNaN(route.query.page) ? 1 : parseInt(route.query.page);
pageSize.value = isNaN(route.query.pageSize) ? defaultPageSize : parseInt(route.query.pageSize);

// Ensure tagFilters is always an array of strings
filters.value = Array.isArray(route.query.filters)
? route.query.filters as string[]
: (route.query.filters ? [route.query.filters as string] : []);
});

watch(currentPage, () => {
router.push({
router.replace({
query: {
search: searchQuery.value,
filters: filters.value.length > 0 ? filters.value : [],
@@ -106,11 +94,11 @@ watch(currentPage, () => {
}
});

loadUserProfiles();
loadUserProfiles();
});

watch([pageSize, searchQuery, filters, itemsSorting], () => {
router.push({
router.replace({
query: {
search: searchQuery.value,
filters: filters.value.length > 0 ? filters.value : [],