mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-13 17:20:14 +00:00
fix(dashboard): fix group searching
This commit is contained in:
parent
96622c5bd4
commit
b4e7f9a6c3
1 changed files with 2 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ import type { ListOptions, PageOptions } from './types';
|
||||||
|
|
||||||
export function filterList(list: Group[]|Member[], groups: Group[], options: ListOptions, type?: string): Group[]|Member[] {
|
export function filterList(list: Group[]|Member[], groups: Group[], options: ListOptions, type?: string): Group[]|Member[] {
|
||||||
let searchedList = search(list, options);
|
let searchedList = search(list, options);
|
||||||
|
|
||||||
let groupedList = [...searchedList];
|
let groupedList = [...searchedList];
|
||||||
if (type)
|
if (type)
|
||||||
groupedList = group(searchedList, groups, options, type);
|
groupedList = group(searchedList, groups, options, type);
|
||||||
|
|
@ -143,8 +144,7 @@ function sort<T extends Member|Group>(list: T[], options: ListOptions): T[] {
|
||||||
return newList;
|
return newList;
|
||||||
}
|
}
|
||||||
|
|
||||||
function group<T extends Member|Group>(members: Member[], groups: Group[], options: ListOptions, type?: string): Group[]|Member[] {
|
function group(list: Member[]|Group[], groups: Group[], options: ListOptions, type?: string): Group[]|Member[] {
|
||||||
let list = type === "member" ? [...members] : [...groups] || []
|
|
||||||
let groupFilterList = [...list]
|
let groupFilterList = [...list]
|
||||||
|
|
||||||
if (options.groups.filter === "include")
|
if (options.groups.filter === "include")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue