chore(api): add explicit type casting for request payloads

This commit is contained in:
jessy-david-dev
2026-04-11 15:20:29 +02:00
parent 7d1b236b46
commit d5a66c2dac
13 changed files with 204 additions and 96 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
import { NextResponse } from "next/server";
import { prisma } from "../../../../lib/prisma";
// GET /api/admin/daily liste tous les puzzles
// GET /api/admin/daily - liste tous les puzzles
export async function GET() {
const puzzles = await prisma.dailyPuzzle.findMany({
orderBy: { date: "desc" },
@@ -11,9 +11,9 @@ export async function GET() {
return NextResponse.json(puzzles);
}
// POST /api/admin/daily créer un puzzle pour une date
// POST /api/admin/daily - créer un puzzle pour une date
export async function POST(req: Request) {
const { date, startArticle, targetArticle } = await req.json() as {
const { date, startArticle, targetArticle } = (await req.json()) as {
date: string;
startArticle: string;
targetArticle: string;