use actix_web::{HttpResponse, web}; use crate::api::response::{ApiErrorResponse, ApiResponse}; use crate::error::AppError; use crate::service::AppService; use crate::session::Session; /// Clear all notifications (dismiss all) #[utoipa::path( delete, path = "/api/v1/notifications", tag = "Notifications", operation_id = "notificationClearAll", responses( (status = 200, description = "All notifications cleared", body = ApiResponse), (status = 401, description = "Authentication required or session expired", body = ApiErrorResponse), (status = 500, description = "Internal server error", body = ApiErrorResponse), ), security( ("session_cookie" = []) ) )] pub async fn clear_all_notifications( service: web::Data, session: Session, ) -> Result { let result = service.notify.clear_all_notifications(&session).await?; Ok(HttpResponse::Ok().json(ApiResponse::new(result))) }