From 4e602abf493f65cb33f1ea52c16b294d118f28c4 Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Sat, 14 Mar 2026 14:00:06 +0530 Subject: [PATCH] feat: Filter agent profiles by `verificationStatus: 'APPROVED'` in search, featured, and top-rated listings. --- src/agents/agents.service.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/agents/agents.service.ts b/src/agents/agents.service.ts index 66c2c40..a156a7e 100644 --- a/src/agents/agents.service.ts +++ b/src/agents/agents.service.ts @@ -196,8 +196,10 @@ export class AgentsService { const skip = (page - 1) * limit; - // Build where clause - const where: Prisma.AgentProfileWhereInput = {}; + // Build where clause — only show admin-approved profiles in search + const where: Prisma.AgentProfileWhereInput = { + verificationStatus: 'APPROVED', + }; if (search) { where.OR = [ @@ -458,6 +460,7 @@ export class AgentsService { where: { isVerified: true, isFeatured: true, + verificationStatus: 'APPROVED', }, take: limit, orderBy: [{ averageRating: 'desc' }, { totalReviews: 'desc' }], @@ -481,6 +484,7 @@ export class AgentsService { where: { isVerified: true, totalReviews: { gte: 5 }, + verificationStatus: 'APPROVED', }, take: limit, orderBy: [{ averageRating: 'desc' }, { totalReviews: 'desc' }],