19 lines
495 B
TypeScript
19 lines
495 B
TypeScript
import { NextResponse } from "next/server";
|
|
|
|
import { prisma } from "@utils/prisma";
|
|
|
|
export async function GET(request: Request) {
|
|
try {
|
|
const artefact = await prisma.artefact.findMany();
|
|
|
|
return NextResponse.json({
|
|
message: "Got artefacts successfully",
|
|
artefact
|
|
}, { status: 200 });
|
|
|
|
} catch (error) {
|
|
console.error("Error in artefacts endpoint:", error);
|
|
return NextResponse.json({ message: "Internal Server Error" }, { status: 500 });
|
|
}
|
|
}
|