Skip to content

Commit

Permalink
fix: add batch edit feature
Browse files Browse the repository at this point in the history
  • Loading branch information
amjed-ali-k committed Oct 28, 2023
1 parent 7fa098d commit c9f39e3
Show file tree
Hide file tree
Showing 5 changed files with 710 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/app/api/secure/exam-seating/student-batches/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,21 @@ export async function DELETE(request: NextRequest) {

return NextResponse.json(results);
}

export async function GET(request: NextRequest) {
const userId = await getUserId(request);
if (!userId)
return NextResponse.json({ message: "Unauthenticated" }, { status: 401 });

const id = request.nextUrl.searchParams.get("id");
if (!id)
return NextResponse.json({ message: "Invalid request" }, { status: 400 });

const result = await prisma.studentBatchForExam.findUnique({
where: {
id: id,
},
});

return NextResponse.json(result);
}
Loading

0 comments on commit c9f39e3

Please sign in to comment.