feat: Filter agent profiles by verificationStatus: 'APPROVED' in search, featured, and top-rated listings.

This commit is contained in:
pradeepkumar committed 2026-03-14 14:00:06 +05:30
1 parent c431c751e8
commit 4e602abf49
1 file changed
+6 -2
+6 -2
View File
@@ -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' }],