feat: add id field to role (#470)

This commit is contained in:
Angelo Kontaxis
2026-01-09 20:06:16 +00:00
committed by GitHub
parent a5387b64af
commit 2afea56e56
14 changed files with 124 additions and 69 deletions

View File

@@ -40,17 +40,10 @@ pub async fn create(
}));
};
let role = Role {
name: data.name,
// Rank of the new role should be below the lowest role
rank: server.roles.len() as i64,
colour: None,
hoist: false,
permissions: Default::default(),
};
let role = Role::create(db, &server, data.name).await?;
Ok(Json(v0::NewRoleResponse {
id: role.create(db, &server.id).await?,
id: role.id.clone(),
role: role.into(),
}))
}