feat: add moderation center for reports and ratings with user cleanup cron job

This commit is contained in:
2026-10-16 07:23:00 +02:00
parent af6ec84cd0
commit edcb229c42
7 changed files with 126 additions and 17 deletions

View File

@@ -46,7 +46,17 @@ export async function GET(
}
});
return NextResponse.json(ratings);
// 3. Fallback for deleted users
const formattedRatings = ratings.map(r => ({
...r,
user: r.user || {
id: null,
name: "Utilisateur supprimé",
avatar: null
}
}));
return NextResponse.json(formattedRatings);
} catch (error: any) {
console.error('Error fetching ratings:', error);