feat: added sort for roles in both user and identity details view

This commit is contained in:
=
2025-06-03 21:04:02 +05:30
parent 5878904f77
commit 817e762e6b
2 changed files with 19 additions and 3 deletions
@@ -412,7 +412,15 @@ export const identityProjectDALFactory = (db: TDbClient) => {
}
]
});
return members;
return members.map((el) => ({
...el,
roles: el.roles.sort((a, b) => {
const roleA = (a.customRoleName || a.role).toLowerCase();
const roleB = (b.customRoleName || b.role).toLowerCase();
return roleA.localeCompare(roleB);
})
}));
} catch (error) {
throw new DatabaseError({ error, name: "FindByProjectId" });
}