This commit is contained in:
PxlLoewe
2025-04-29 21:35:27 -07:00
parent 0d7f0ad2b8
commit ee49bdde89
12 changed files with 93 additions and 92 deletions

View File

@@ -1,24 +0,0 @@
import { Prisma, prisma } from "@repo/db";
import { NextRequest, NextResponse } from "next/server";
export const POST = async (req: NextRequest) => {
console.log(req.body);
const body = await req.json();
console.log(body);
const missions = await prisma.mission.findMany({
where: (body.filter as Prisma.MissionWhereInput) || {},
});
return NextResponse.json(missions);
};
export const PUT = async (req: NextRequest) => {
const body = await req.json();
const newMission = await prisma.mission.create({
data: body,
});
return NextResponse.json(newMission);
};