fix: sync totalRounds changes to server, filter geographic admin articles, validate user exists before saving game

This commit is contained in:
jessy-david-dev
2026-04-13 15:42:00 +02:00
parent 79d90b75c4
commit 2a3dd6be56
7 changed files with 121 additions and 29 deletions
+8
View File
@@ -20,6 +20,14 @@ export async function POST(req: NextRequest) {
won: boolean;
};
const userExists = await prisma.user.findUnique({
where: { id: session.user.id },
select: { id: true },
});
if (!userExists) {
return NextResponse.json({ error: "Utilisateur introuvable" }, { status: 401 });
}
const game = await prisma.game.create({
data: {
userId: session.user.id,