feat: add post endpoint for complex criteria

refactor: also accept boolean for queryOrNot fn
This commit is contained in:
Methapon Metanipat 2024-11-11 13:08:49 +07:00
parent 773c7f97d8
commit 00ce2abc7e
2 changed files with 92 additions and 1 deletions

View file

@ -28,6 +28,6 @@ export function whereAddressQuery(query: string) {
];
}
export function queryOrNot<T>(query: string, where: T): T | undefined {
export function queryOrNot<T>(query: string | boolean, where: T): T | undefined {
return !!query ? where : undefined;
}