search startDate and endDate
This commit is contained in:
parent
ee610c5686
commit
0aba9f9865
20 changed files with 123 additions and 32 deletions
|
|
@ -27,7 +27,7 @@ import {
|
|||
createPermCheck,
|
||||
createPermCondition,
|
||||
} from "../services/permission";
|
||||
import { queryOrNot } from "../utils/relation";
|
||||
import { queryOrNot, whereDateQuery } from "../utils/relation";
|
||||
import { notFoundError } from "../utils/error";
|
||||
import { deleteFile, fileLocation, getFile, getPresigned, listFile, setFile } from "../utils/minio";
|
||||
import HttpError from "../interfaces/http-error";
|
||||
|
|
@ -81,6 +81,8 @@ export class RequestDataController extends Controller {
|
|||
@Query() quotationId?: string,
|
||||
@Query() code?: string,
|
||||
@Query() incomplete?: boolean,
|
||||
@Query() startDate?: Date,
|
||||
@Query() endDate?: Date,
|
||||
) {
|
||||
const where = {
|
||||
OR: queryOrNot<Prisma.RequestDataWhereInput[]>(query, [
|
||||
|
|
@ -147,6 +149,7 @@ export class RequestDataController extends Controller {
|
|||
id: quotationId,
|
||||
registeredBranch: { OR: permissionCond(req.user) },
|
||||
},
|
||||
...whereDateQuery(startDate, endDate),
|
||||
} satisfies Prisma.RequestDataWhereInput;
|
||||
|
||||
const [result, total] = await prisma.$transaction([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue