Skip to content

Commit

Permalink
test this fix
Browse files Browse the repository at this point in the history
  • Loading branch information
himohitmehta committed Nov 29, 2023
1 parent fafb809 commit 633e0b3
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions apps/application/app/api/sites/route.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { getSession } from "@/lib/auth";
import prisma from "@/lib/prisma";
import { NextResponse } from "next/server";
// import { NextResponse } from "next/server";

export async function GET() {
export async function GET(req, res) {
const session = await getSession();
if (!session) {
return {
status: 401,
body: {
message: "Unauthorized",
},
};
return NextResponse.json({
result: null,
status: "error",
message: "unauthorized",
});
}
// const {} = req.json();
const sites = await prisma.site.findMany({
Expand All @@ -24,13 +24,8 @@ export async function GET() {
},
// ...(limit ? { take: limit } : {}),
});
return new Response.json({
return NextResponse.json({
result: sites,
status: "success",
});
// })
// NextResponse.json({
// result: sites,
// status: "success",
// });
}

0 comments on commit 633e0b3

Please sign in to comment.