receipts/add: Skip updating notes if unchanged

If the value of the `notes` form field is the same as the current value
for the same field of an existing Firefly transaction, we do not need to
update it.
bugfix/ci-buildah
Dustin 2025-03-14 20:18:44 -05:00
parent 1393c993e9
commit f3d31a7256
1 changed files with 6 additions and 2 deletions

View File

@ -128,8 +128,12 @@ pub async fn add_receipt(
needs_update = true;
}
if !data.notes.is_empty() {
split.notes = Some(data.notes.clone());
needs_update = true;
if let Some(notes) = split.notes.as_deref() {
if notes != data.notes.as_str() {
split.notes = Some(data.notes.clone());
needs_update = true;
}
}
}
} else {
debug!("Transaction {} has no splits", id);