hive-agent: replace json! with typed structs in web_ui handlers

This commit is contained in:
damocles 2026-08-13 19:21:05 +02:00 committed by mara
commit 786e4610f0
3 changed files with 34 additions and 15 deletions

View file

@ -7,7 +7,7 @@ use axum::{
http::StatusCode,
response::{IntoResponse, Response},
};
use serde::Deserialize;
use serde::{Deserialize, Serialize};
use super::{AppState, SigintOutcome, error_response};
@ -202,5 +202,10 @@ pub(super) async fn post_mark_todos_done(Form(form): Form<MarkTodosDoneForm>) ->
acked += count;
}
}
axum::Json(serde_json::json!({ "acked": acked })).into_response()
axum::Json(MarkTodosDoneBody { acked }).into_response()
}
#[derive(Serialize)]
struct MarkTodosDoneBody {
acked: u64,
}