chore(api): add explicit type casting for request payloads
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user