mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-19 16:36:46 +00:00
18 lines
510 B
TypeScript
18 lines
510 B
TypeScript
|
|
import { NextResponse } from "next/server";
|
||
|
|
import prisma from "@/app/prisma";
|
||
|
|
|
||
|
|
export async function GET() {
|
||
|
|
try {
|
||
|
|
const user = await prisma.user.findMany();
|
||
|
|
|
||
|
|
if (user.length < 1) {
|
||
|
|
return NextResponse.json({ message: "No users found" }, { status: 200 });
|
||
|
|
}
|
||
|
|
|
||
|
|
return NextResponse.json({ message: "Users found" }, { status: 200 });
|
||
|
|
|
||
|
|
} catch (error: any) {
|
||
|
|
return NextResponse.json({ error: "Internal Server Error" }, { status: 500 });
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|