Update various configuration files, components, and assets; enhance notification system and API endpoints; improve documentation and styles across the application.
This commit is contained in:
33
server/api/devtool/menu/role-list.js
Normal file
33
server/api/devtool/menu/role-list.js
Normal file
@@ -0,0 +1,33 @@
|
||||
export default defineEventHandler(async (event) => {
|
||||
try {
|
||||
const roles = await prisma.role.findMany({
|
||||
select: {
|
||||
roleID: true,
|
||||
roleName: true,
|
||||
},
|
||||
where: {
|
||||
roleStatus: {
|
||||
not: "DELETED",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (roles) {
|
||||
return {
|
||||
statusCode: 200,
|
||||
message: "Roles successfully fetched",
|
||||
data: roles,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
statusCode: 404,
|
||||
message: "No Roles found",
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
return {
|
||||
statusCode: 500,
|
||||
message: error.message,
|
||||
};
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user