This commit is contained in:
2025-12-04 13:17:31 +01:00
parent e8f578eb48
commit 0a67d88ff2
+2 -8
View File
@@ -178,7 +178,6 @@ struct DocumentUpdateChangeset {
struct DocumentUpdatePlan { struct DocumentUpdatePlan {
changeset: DocumentUpdateChangeset, changeset: DocumentUpdateChangeset,
title_changed: bool,
} }
#[derive(Deserialize, ToSchema)] #[derive(Deserialize, ToSchema)]
@@ -273,7 +272,6 @@ impl<'a> DocumentsService<'a> {
let mut changes = DocumentUpdateChangeset::default(); let mut changes = DocumentUpdateChangeset::default();
let mut has_changes = false; let mut has_changes = false;
let mut title_changed = false;
if let Some(ref candidate) = title { if let Some(ref candidate) = title {
let trimmed = candidate.trim(); let trimmed = candidate.trim();
@@ -288,7 +286,6 @@ impl<'a> DocumentsService<'a> {
changes.filename = Some(new_filename); changes.filename = Some(new_filename);
} }
has_changes = true; has_changes = true;
title_changed = true;
} }
} }
@@ -336,7 +333,6 @@ impl<'a> DocumentsService<'a> {
Ok(DocumentUpdatePlan { Ok(DocumentUpdatePlan {
changeset: changes, changeset: changes,
title_changed,
}) })
} }
@@ -1184,10 +1180,8 @@ impl<'a> DocumentsService<'a> {
let payload_obj = payload let payload_obj = payload
.as_object() .as_object()
.ok_or_else(|| AppError::bad_request("request body must be a JSON object"))?; .ok_or_else(|| AppError::bad_request("request body must be a JSON object"))?;
let DocumentUpdatePlan { let DocumentUpdatePlan { mut changeset } =
mut changeset, Self::build_document_update_plan(&document, payload_obj)?;
title_changed,
} = Self::build_document_update_plan(&document, payload_obj)?;
let now = Utc::now().naive_utc(); let now = Utc::now().naive_utc();
changeset.updated_at = Some(now); changeset.updated_at = Some(now);