fix: service not included in result

This commit is contained in:
Methapon2001 2024-06-25 13:00:15 +07:00
parent 6550ce1bb3
commit e3e44d03b5

View file

@ -59,7 +59,9 @@ export class ProductServiceController extends Controller {
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}`);
if (productTypeId) {
and.push(Prisma.sql`("productTypeId" = ${productTypeId} OR ("type" = 'service'))`);
}
const where = Prisma.sql`
${or.length > 0 || and.length > 0 ? Prisma.sql`WHERE ` : Prisma.empty}