search startDate and endDate

This commit is contained in:
Kanjana 2025-04-17 13:41:22 +07:00
parent ee610c5686
commit 0aba9f9865
20 changed files with 123 additions and 32 deletions

View file

@ -51,6 +51,7 @@ import {
connectOrNot,
queryOrNot,
whereAddressQuery,
whereDateQuery,
} from "../utils/relation";
import { isUsedError, notFoundError, relationError } from "../utils/error";
import { retry } from "../utils/func";
@ -305,6 +306,8 @@ export class UserController extends Controller {
@Query() status?: Status,
@Query() responsibleDistrictId?: string,
@Query() activeBranchOnly?: boolean,
@Query() startDate?: Date,
@Query() endDate?: Date,
@Body()
body?: {
userId?: string[];
@ -368,6 +371,7 @@ export class UserController extends Controller {
},
},
},
...whereDateQuery(startDate, endDate),
} satisfies Prisma.UserWhereInput;
const [result, total] = await prisma.$transaction([