search startDate and endDate
This commit is contained in:
parent
ee610c5686
commit
0aba9f9865
20 changed files with 123 additions and 32 deletions
|
|
@ -35,7 +35,7 @@ import {
|
|||
} from "../utils/minio";
|
||||
import { notFoundError } from "../utils/error";
|
||||
import { CreditNotePaybackType, CreditNoteStatus, Prisma, RequestDataStatus } from "@prisma/client";
|
||||
import { queryOrNot } from "../utils/relation";
|
||||
import { queryOrNot, whereDateQuery } from "../utils/relation";
|
||||
import { PaybackStatus, RequestWorkStatus } from "../generated/kysely/types";
|
||||
|
||||
const MANAGE_ROLES = [
|
||||
|
|
@ -143,6 +143,8 @@ export class CreditNoteController extends Controller {
|
|||
@Query() quotationId?: string,
|
||||
@Query() creditNoteStatus?: CreditNoteStatus,
|
||||
@Body() body?: {},
|
||||
@Query() startDate?: Date,
|
||||
@Query() endDate?: Date,
|
||||
) {
|
||||
const where = {
|
||||
OR: queryOrNot<Prisma.CreditNoteWhereInput[]>(query, [
|
||||
|
|
@ -199,6 +201,7 @@ export class CreditNoteController extends Controller {
|
|||
},
|
||||
},
|
||||
},
|
||||
...whereDateQuery(startDate, endDate),
|
||||
} satisfies Prisma.CreditNoteWhereInput;
|
||||
|
||||
const [result, total] = await prisma.$transaction([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue