mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
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:
co-authored by
Claude Sonnet 4.6
parent
913bf0e839
commit
8153a216b9
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user