Skip to main content

update_unit

Function update_unit 

Source
pub fn update_unit(
    mana_dir: &Path,
    id: &str,
    params: UpdateParams,
) -> Result<UpdateResult, Error>
Expand description

Update a unit’s fields.

Only fields set to Some(...) are updated. Notes are appended with a timestamp separator rather than replaced.

§Errors

  • anyhow::Error — unit not found, validation failure, or hook rejection

§Example

use mana_core::api::update_unit;
use mana_core::ops::update::UpdateParams;
use std::path::Path;

let result = update_unit(Path::new("/project/.mana"), "1", UpdateParams {
    notes: Some("Discovered the root cause: off-by-one in pagination".to_string()),
    ..Default::default()
}).unwrap();