use axum::Json; use axum::extract::State; use jwt::extractor::AuthUser; use crate::error::UserResult; use crate::features::UserService; use crate::features::notifications::UnreadCountResp; #[utoipa::path( get, path = "/user/me/notifications/unread-count", tag = "user", responses( (status = 200, description = "Number of unread notifications for the caller.", body = UnreadCountResp), ), security(("bearer_auth" = [])), )] pub(crate) async fn handler( State(svc): State, AuthUser { claims }: AuthUser, ) -> UserResult> { Ok(Json(svc.unread_notifications_count(claims.sub).await?)) }