fix: query

This commit is contained in:
Methapon2001 2024-06-25 14:54:58 +07:00
parent 7cf75edf76
commit 3211cbe8b7

View file

@ -58,7 +58,7 @@ export class ProductServiceController extends Controller {
const or: Prisma.Sql[] = [];
const and: Prisma.Sql[] = [];
if (query) or.push(Prisma.sql`"name" LIKE '%${query}%'`);
if (query) or.push(Prisma.sql`"name" LIKE ${`%${query}%`}`);
if (status) and.push(Prisma.sql`"status" = ${status}::"Status"`);
if (productTypeId) {
and.push(Prisma.sql`("productTypeId" = ${productTypeId} OR ("type" = 'service'))`);