feat: add util function to include or not include condition
This commit is contained in:
parent
85b99bf0a1
commit
b0bd401f25
1 changed files with 4 additions and 0 deletions
|
|
@ -27,3 +27,7 @@ export function whereAddressQuery(query: string) {
|
|||
{ subDistrict: { zipCode: { contains: query } } },
|
||||
];
|
||||
}
|
||||
|
||||
export function queryOrNot<T>(query: string, where: T): T | undefined {
|
||||
return !!query ? where : undefined;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue