fix: add splitting of values for btw operator (#150)

This commit is contained in:
burdinbogdan 2022-01-27 15:29:35 +02:00 committed by GitHub
parent 5239b7b0b7
commit 7d85cf94b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,7 +147,7 @@ function parseFilter<T>(query: PaginateQuery, config: PaginateConfig<T>) {
continue
}
if (isOperator(op1)) {
const args = op1 === FilterOperator.IN ? value.split(',') : value
const args = op1 === FilterOperator.IN || op1 === FilterOperator.BTW ? value.split(',') : value
filter[column] =
op1 === FilterOperator.BTW ? getOperatorFn<T>(op1)(args[0], args[1]) : getOperatorFn<T>(op1)(args)
}