From b4e7f9a6c30bdb7f897785324c59a9c8afe68742 Mon Sep 17 00:00:00 2001 From: Jake Fulmine Date: Sat, 3 Jun 2023 20:57:34 +0200 Subject: [PATCH] fix(dashboard): fix group searching --- dashboard/src/components/list/functions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboard/src/components/list/functions.ts b/dashboard/src/components/list/functions.ts index 913ca768..30eb235d 100644 --- a/dashboard/src/components/list/functions.ts +++ b/dashboard/src/components/list/functions.ts @@ -3,6 +3,7 @@ import type { ListOptions, PageOptions } from './types'; export function filterList(list: Group[]|Member[], groups: Group[], options: ListOptions, type?: string): Group[]|Member[] { let searchedList = search(list, options); + let groupedList = [...searchedList]; if (type) groupedList = group(searchedList, groups, options, type); @@ -143,8 +144,7 @@ function sort(list: T[], options: ListOptions): T[] { return newList; } -function group(members: Member[], groups: Group[], options: ListOptions, type?: string): Group[]|Member[] { - let list = type === "member" ? [...members] : [...groups] || [] +function group(list: Member[]|Group[], groups: Group[], options: ListOptions, type?: string): Group[]|Member[] { let groupFilterList = [...list] if (options.groups.filter === "include")