diff options
| author | Kit La Touche <kit@transneptune.net> | 2025-07-30 23:08:40 -0400 |
|---|---|---|
| committer | Kit La Touche <kit@transneptune.net> | 2025-07-30 23:08:40 -0400 |
| commit | ed5e175a806f45469a6e5504ba0d3f5246997fad (patch) | |
| tree | 0d4233c57596186b86d165640ca4721e7495567d /src/push/handlers/unregister.rs | |
| parent | b63380b251d04dd92f06aa5bbc22a72ca3e4bf8e (diff) | |
Test receiving push events when backgrounded
And thus also displaying notifications.
Diffstat (limited to 'src/push/handlers/unregister.rs')
| -rw-r--r-- | src/push/handlers/unregister.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/push/handlers/unregister.rs b/src/push/handlers/unregister.rs index a00ee92..b35dbd5 100644 --- a/src/push/handlers/unregister.rs +++ b/src/push/handlers/unregister.rs @@ -1,16 +1,23 @@ use axum::{ - extract::{Path, State}, + extract::{Json, State}, http::StatusCode, }; -use crate::{app::App, error::Internal, push::Id, token::extract::Identity}; +use crate::{app::App, error::Internal, token::extract::Identity}; + + +#[derive(serde::Deserialize)] +pub struct Request { + endpoint: String, +} pub async fn handler( State(app): State<App>, identity: Identity, - Path(subscription): Path<Id>, + Json(request): Json<Request>, ) -> Result<StatusCode, Internal> { - app.push().unregister(&identity.user, &subscription).await?; + let Request { endpoint } = request; + app.push().unregister(&identity.user, &endpoint).await?; Ok(StatusCode::NO_CONTENT) } |
