mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
revert forced role sort in api
This commit is contained in:
parent
47994b518b
commit
d4c26825de
1 changed files with 9 additions and 12 deletions
|
@ -47,18 +47,15 @@ export const getGuild = async (
|
||||||
.filter((x) => x !== undefined) as APIRole[]
|
.filter((x) => x !== undefined) as APIRole[]
|
||||||
)?.position || -1;
|
)?.position || -1;
|
||||||
|
|
||||||
const roles = guildRaw.roles
|
const roles = guildRaw.roles.map<Role>((role) => ({
|
||||||
.map<Role>((role) => ({
|
id: role.id,
|
||||||
id: role.id,
|
name: role.name,
|
||||||
name: role.name,
|
color: role.color,
|
||||||
color: role.color,
|
managed: role.managed,
|
||||||
managed: role.managed,
|
position: role.position,
|
||||||
position: role.position,
|
permissions: role.permissions,
|
||||||
permissions: role.permissions,
|
safety: calculateRoleSafety(role, highestRolePosition),
|
||||||
safety: calculateRoleSafety(role, highestRolePosition),
|
}));
|
||||||
}))
|
|
||||||
// sort so that highest is first
|
|
||||||
.sort((a, b) => b.position - a.position);
|
|
||||||
|
|
||||||
const guild: Guild & OwnRoleInfo = {
|
const guild: Guild & OwnRoleInfo = {
|
||||||
id,
|
id,
|
||||||
|
|
Loading…
Add table
Reference in a new issue