Add mark as new API endpoint for notifications

POST /api/notifications/{id}/mark_as_new sets is_new=1, allowing a notification to be flagged as unread after it has been read.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
rzuasti
2026-05-27 10:13:56 -04:00
co-authored by Claude Sonnet 4.6
parent 913bf0e839
commit 8153a216b9
3 changed files with 64 additions and 1 deletions
+5 -1
View File
@@ -5,7 +5,7 @@ use axum::extract::Request;
use axum::http::StatusCode;
use axum::middleware::Next;
use axum::response::Response;
use axum::routing::{delete, get, put};
use axum::routing::{delete, get, post, put};
use axum::{Router, http};
use log::{debug, error, info};
use tower::ServiceBuilder;
@@ -38,6 +38,10 @@ pub async fn serve() -> Result<(), Box<dyn Error>> {
"/api/notifications/{id}/read_without_flagging",
get(notifications::read_without_flagging),
)
.route(
"/api/notifications/{id}/mark_as_new",
post(notifications::mark_as_new),
)
.route_layer(axum::middleware::from_fn(auth))
.layer(ServiceBuilder::new().layer(cors_layer))
.route(