1
0
mirror of https://github.com/Fayorg/calendrier-avant.git synced 2026-05-28 01:28:37 +02:00

added michal's styles to the results page

This commit is contained in:
timhaller
2023-12-10 12:26:10 +01:00
parent bf49b94a03
commit 4157269251
28 changed files with 1099 additions and 338 deletions

View File

@@ -1,4 +1,4 @@
import {NextResponse} from "next/server";
import {NextRequest, NextResponse} from "next/server";
import prisma from "@/lib/prisma";
interface IBody {
@@ -80,5 +80,14 @@ export async function POST(req: Request){
createdAt: grade.createdAt
}
});
return NextResponse.json({message: 'Server error'}, {status: 500})
}
export async function GET(req: NextRequest){
const key = req.nextUrl.searchParams.get("key");
if(!key) return NextResponse.json({error: "No key provided"}, {status: 400});
const grades = await prisma.grade.findMany({})
return NextResponse.json(grades, {status: 200});
}