diff options
Diffstat (limited to 'src/push/handlers/unregister.rs')
| -rw-r--r-- | src/push/handlers/unregister.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/push/handlers/unregister.rs b/src/push/handlers/unregister.rs new file mode 100644 index 0000000..a00ee92 --- /dev/null +++ b/src/push/handlers/unregister.rs @@ -0,0 +1,16 @@ +use axum::{ + extract::{Path, State}, + http::StatusCode, +}; + +use crate::{app::App, error::Internal, push::Id, token::extract::Identity}; + +pub async fn handler( + State(app): State<App>, + identity: Identity, + Path(subscription): Path<Id>, +) -> Result<StatusCode, Internal> { + app.push().unregister(&identity.user, &subscription).await?; + + Ok(StatusCode::NO_CONTENT) +} |
