This PR adds support for including/excluding specific items from team filtering. Users can use the filter modal to only show teams that include specific items, only show teams that _don't_ include specific items, or combine the two to create a very powerful filter.
21 lines
465 B
TypeScript
21 lines
465 B
TypeScript
import cloneDeep from 'lodash.clonedeep'
|
|
|
|
export function convertAdvancedFilters(filters: FilterSet) {
|
|
let copy = cloneDeep(filters)
|
|
|
|
const includes = filterString(filters.includes || [])
|
|
const excludes = filterString(filters.excludes || [])
|
|
|
|
delete copy.includes
|
|
delete copy.excludes
|
|
|
|
return {
|
|
...copy,
|
|
includes,
|
|
excludes,
|
|
}
|
|
}
|
|
|
|
export function filterString(list: MentionItem[]) {
|
|
return list.map((item) => item.granblue_id).join(',')
|
|
}
|