Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/adapters/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ impl HttpAdapter {
.route("/{guild_id}/status", get(queue_status))
.route("/{guild_id}/queue", get(list_queue))
.route("/{guild_id}/queue/sse", get(list_queue_sse))
.route("/{guild_id}/total", get(total_vaffel))
.layer(cors)
.layer(TraceLayer::new_for_http())
.with_state(state);
Expand Down Expand Up @@ -76,6 +77,14 @@ async fn list_queue(
Json(queue)
}

async fn total_vaffel(
State(state): State<Arc<AppState>>,
Path(guild_id): Path<String>,
) -> Json<i64> {
let stats = state.orders.daily_stats(&guild_id).await.unwrap();
Json(stats.total_orders)
}

async fn list_queue_sse(
State(state): State<Arc<AppState>>,
Path(guild_id): Path<String>,
Expand Down