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,26 @@
const getRolesMock = async (roles) => {
const data = roles.map((role) => {
return {
id: role.id,
key: role.key,
name: role.name,
isAdmin: role.isAdmin,
description: role.description,
createdAt: role.createdAt.toISOString(),
updatedAt: role.updatedAt.toISOString(),
};
});
return {
data: data,
meta: {
count: data.length,
currentPage: null,
isArray: true,
totalPages: null,
type: 'Role',
},
};
};
export default getRolesMock;