feat: Implement admin get roles API endpoint

This commit is contained in:
Faruk AYDIN
2024-02-21 15:35:30 +01:00
parent b21074c871
commit 3bf1f79c79
5 changed files with 86 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
import { renderObject } from '../../../../../helpers/renderer.js';
import Role from '../../../../../models/role.js';
export default async (request, response) => {
const roles = await Role.query().orderBy('name');
renderObject(response, roles);
};