api/ws/tickets/mod.rs
1use axum::{middleware::{from_fn_with_state}, routing::get, Router};
2use util::state::AppState;
3
4use crate::{auth::guards::require_ticket_ws_access, ws::tickets::handlers::ticket_chat_handler};
5
6pub mod topics;
7pub mod handlers;
8pub mod ws_handlers;
9pub mod common;
10
11pub fn ws_ticket_routes(app_state: AppState) -> Router<AppState> {
12 Router::new()
13 .route("/{ticket_id}", get(ticket_chat_handler))
14 .route_layer(from_fn_with_state(app_state.clone(), require_ticket_ws_access))
15}