/home/techb158/cosmic-risk.abdallabala.com/src/app/api/roles
Edit: /home/techb158/cosmic-risk.abdallabala.com/src/app/api/roles/route.js (337B)
const { prisma } = require("../../../lib/prisma");
const { jsonResponse, errorResponse } = require("../../../lib/http");
export async function GET() {
try {
const roles = await prisma.role.findMany({
orderBy: { name: "asc" }
});
return jsonResponse(roles);
} catch (error) {
return errorResponse(error);
}
}