Formatting and cleanup

This commit is contained in:
2026-04-04 14:33:07 -04:00
parent f17e5061cd
commit 070337577c
20 changed files with 237 additions and 421 deletions

View File

@@ -61,10 +61,6 @@ pub fn get_routes() -> Router<Arc<AppState>> {
.route("/maps/{id}/ws", get(ws_handler))
}
// ---------------------------------------------------------------------------
// Access helpers
// ---------------------------------------------------------------------------
/// Fetch the role of `user_id` on `map_id`, or `None` if no record exists.
async fn get_user_role(map_id: &str, user_id: Uuid) -> Result<Option<MapRole>> {
let pool = siren_core::data::pool();
@@ -120,10 +116,6 @@ async fn is_owner(map: &GridMap, session: &Option<Session>) -> bool {
.unwrap_or(false)
}
// ---------------------------------------------------------------------------
// Map CRUD
// ---------------------------------------------------------------------------
pub async fn list_maps(
SessionAuthorization(session): SessionAuthorization,
) -> Result<Json<Vec<ListedMap>>> {
@@ -287,10 +279,6 @@ pub async fn delete_map(
Ok(StatusCode::NO_CONTENT)
}
// ---------------------------------------------------------------------------
// Permission management
// ---------------------------------------------------------------------------
pub async fn list_permissions(
SessionAuthorization(session): SessionAuthorization,
Path(id): Path<String>,
@@ -429,10 +417,6 @@ pub async fn unfavorite_map(
Ok(StatusCode::NO_CONTENT)
}
// ---------------------------------------------------------------------------
// Access Requests
// ---------------------------------------------------------------------------
pub async fn create_access_request(
SessionAuthorization(session): SessionAuthorization,
Path(id): Path<String>,
@@ -572,10 +556,6 @@ pub async fn resolve_access_request(
Ok(StatusCode::NO_CONTENT)
}
// ---------------------------------------------------------------------------
// WebSocket handler
// ---------------------------------------------------------------------------
pub async fn ws_handler(
ws: WebSocketUpgrade,
State(state): State<Arc<AppState>>,