From ed5e175a806f45469a6e5504ba0d3f5246997fad Mon Sep 17 00:00:00 2001 From: Kit La Touche Date: Wed, 30 Jul 2025 23:08:40 -0400 Subject: Test receiving push events when backgrounded And thus also displaying notifications. --- src/push/handlers/unregister.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/push/handlers/unregister.rs') 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, identity: Identity, - Path(subscription): Path, + Json(request): Json, ) -> Result { - app.push().unregister(&identity.user, &subscription).await?; + let Request { endpoint } = request; + app.push().unregister(&identity.user, &endpoint).await?; Ok(StatusCode::NO_CONTENT) } -- cgit v1.2.3