added get query to mission store
This commit is contained in:
14
apps/dispatch/app/api/mission/route.ts
Normal file
14
apps/dispatch/app/api/mission/route.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Prisma, prisma } from "@repo/db";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export const GET = (req: NextRequest) => {
|
||||
const filter = req.nextUrl.searchParams.get("filter") as
|
||||
| Prisma.MissionWhereInput
|
||||
| undefined;
|
||||
|
||||
const missions = prisma.mission.findMany({
|
||||
where: filter,
|
||||
});
|
||||
|
||||
return NextResponse.json(missions);
|
||||
};
|
||||
Reference in New Issue
Block a user