Fix build

This commit is contained in:
Adria Navarro 2024-07-09 15:04:41 +02:00
parent 38f7b88735
commit 288d48c60d
2 changed files with 7 additions and 11 deletions

View File

@ -310,16 +310,12 @@ export const buildQuery = (filter: SearchFilter[]) => {
query.equal = query.equal || {}
query.equal[field] = true
} else {
query[queryOperator] = {
...query[queryOperator],
[field]: value,
}
query[queryOperator] ??= {}
query[queryOperator]![field] = value
}
} else {
query[queryOperator] = {
...query[queryOperator],
[field]: value,
}
query[queryOperator] ??= {}
query[queryOperator]![field] = value
}
}
})

View File

@ -21,7 +21,7 @@ export enum InternalSearchFilterOperator {
COMPLEX_ID_OPERATOR = "_complexIdOperator",
}
type BasicFilter = Record<string, string> & {
type BasicFilter<T = any> = Record<string, T> & {
[InternalSearchFilterOperator.COMPLEX_ID_OPERATOR]?: never
}
@ -52,8 +52,8 @@ export interface SearchFilters {
// allows just fuzzy to be or - all the fuzzy/like parameters
fuzzyOr?: boolean
onEmptyFilter?: EmptyFilterOption
[SearchFilterOperator.STRING]?: BasicFilter
[SearchFilterOperator.FUZZY]?: BasicFilter
[SearchFilterOperator.STRING]?: BasicFilter<string>
[SearchFilterOperator.FUZZY]?: BasicFilter<string>
[SearchFilterOperator.RANGE]?: RangeFilter
[SearchFilterOperator.EQUAL]?: BasicFilter
[SearchFilterOperator.NOT_EQUAL]?: BasicFilter