revert forced role sort in api

This commit is contained in:
41666 2023-05-28 11:13:36 -04:00
parent 47994b518b
commit d4c26825de

View file

@ -47,8 +47,7 @@ export const getGuild = async (
.filter((x) => x !== undefined) as APIRole[]
)?.position || -1;
const roles = guildRaw.roles
.map<Role>((role) => ({
const roles = guildRaw.roles.map<Role>((role) => ({
id: role.id,
name: role.name,
color: role.color,
@ -56,9 +55,7 @@ export const getGuild = async (
position: role.position,
permissions: role.permissions,
safety: calculateRoleSafety(role, highestRolePosition),
}))
// sort so that highest is first
.sort((a, b) => b.position - a.position);
}));
const guild: Guild & OwnRoleInfo = {
id,