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