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 = query.equal || {}
query.equal[field] = true query.equal[field] = true
} else { } else {
query[queryOperator] = { query[queryOperator] ??= {}
...query[queryOperator], query[queryOperator]![field] = value
[field]: value,
}
} }
} else { } else {
query[queryOperator] = { query[queryOperator] ??= {}
...query[queryOperator], query[queryOperator]![field] = value
[field]: value,
}
} }
} }
}) })

View File

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