feat: implement core platform features including business directory, admin dashboard, authentication, and API infrastructure
Some checks failed
Build and Push App / build (push) Failing after 16m2s
Some checks failed
Build and Push App / build (push) Failing after 16m2s
This commit is contained in:
@@ -50,3 +50,31 @@ export async function updateReportStatus(id: string, status: 'RESOLVED' | 'DISMI
|
||||
return { success: false, error: "Erreur lors de la mise à jour" };
|
||||
}
|
||||
}
|
||||
|
||||
export async function getPendingRatings() {
|
||||
return await prisma.rating.findMany({
|
||||
where: { status: 'PENDING' },
|
||||
include: {
|
||||
user: {
|
||||
select: { id: true, name: true, email: true }
|
||||
},
|
||||
business: {
|
||||
select: { id: true, name: true }
|
||||
}
|
||||
},
|
||||
orderBy: { createdAt: 'desc' }
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateRatingStatus(id: string, status: 'APPROVED' | 'REJECTED') {
|
||||
try {
|
||||
await prisma.rating.update({
|
||||
where: { id },
|
||||
data: { status }
|
||||
});
|
||||
revalidatePath('/moderation');
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
return { success: false, error: "Erreur lors de la mise à jour de l'avis" };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user