From a1aefda860a102c3bd73e230663bb5634af8e609 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Fri, 13 Feb 2026 13:05:50 +0000 Subject: [PATCH] refactor: use update_response helper in update handlers Replace duplicated datastar/form/json response branching in brew, cup, and roast update handlers with the shared update_response helper. --- src/application/routes/api/coffee/brews.rs | 35 ++++++++++----------- src/application/routes/api/coffee/cups.rs | 25 +++++++-------- src/application/routes/api/coffee/roasts.rs | 15 +++++---- 3 files changed, 36 insertions(+), 39 deletions(-) diff --git a/src/application/routes/api/coffee/brews.rs b/src/application/routes/api/coffee/brews.rs index 1c0bce4..4e899c6 100644 --- a/src/application/routes/api/coffee/brews.rs +++ b/src/application/routes/api/coffee/brews.rs @@ -12,7 +12,7 @@ use crate::application::routes::api::images::save_deferred_image; use crate::application::routes::api::macros::{define_delete_handler, define_enriched_get_handler}; use crate::application::routes::support::{ FlexiblePayload, ListQuery, PayloadSource, impl_has_changes, is_datastar_request, - validate_update, + update_response, validate_update, }; use crate::application::state::AppState; use crate::domain::bags::BagFilter; @@ -64,10 +64,11 @@ pub(crate) async fn load_brew_form_data(state: &AppState) -> Result