use axum::{ Router, extract::{Path, State}, response::{IntoResponse, Response}, routing::delete, }; use http::StatusCode; use rustical_store::SubscriptionStore; use std::sync::Arc; async fn handle_delete( State(store): State>, Path(id): Path, ) -> Result { store.delete_subscription(&id).await?; Ok((StatusCode::NO_CONTENT, "Unregistered").into_response()) } pub fn subscription_service(sub_store: Arc) -> Router { Router::new() .route("/push_subscription/{id}", delete(handle_delete::)) .with_state(sub_store) }