feat: add code to query string

This commit is contained in:
Methapon2001 2024-12-25 10:41:48 +07:00
parent f2c1e84490
commit 5e26e38e0b
2 changed files with 5 additions and 0 deletions

View file

@ -73,9 +73,11 @@ export class RequestDataController extends Controller {
@Query() query: string = "",
@Query() requestDataStatus?: RequestDataStatus,
@Query() quotationId?: string,
@Query() code?: string,
) {
const where = {
OR: queryOrNot<Prisma.RequestDataWhereInput[]>(query, [
{ code: { contains: query, mode: "insensitive" } },
{ quotation: { code: { contains: query, mode: "insensitive" } } },
{ quotation: { workName: { contains: query } } },
{
@ -109,6 +111,7 @@ export class RequestDataController extends Controller {
},
},
]),
code,
requestDataStatus,
quotation: {
id: quotationId,