Support logical operations in filters

This commit is contained in:
rijkvanzanten
2020-07-13 14:55:07 -04:00
parent 72db3f1941
commit 300951e078
7 changed files with 100 additions and 67 deletions

View File

@@ -3,7 +3,7 @@ import { Meta } from './meta';
export type Query = {
fields?: string[];
sort?: Sort[];
filter?: Filter[];
filter?: Filter;
limit?: number;
offset?: number;
page?: number;
@@ -18,9 +18,7 @@ export type Sort = {
};
export type Filter = {
column: string;
operator: FilterOperator;
value: null | string | number | (string | number)[];
[keyOrOperator: string]: Filter | any;
};
export type FilterOperator = 'eq' | 'neq' | 'in' | 'nin' | 'null' | 'nnull';