feat: Filter agent profiles by verificationStatus: 'APPROVED' in search, featured, and top-rated listings.
This commit is contained in:
@@ -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' }],
|
||||
|
||||
Reference in New Issue
Block a user