Skip to main content

apply_item_edit

Function apply_item_edit 

Source
pub async fn apply_item_edit(
    project_dir: &Path,
    id: &ItemId,
    edited: &str,
) -> Result<EditOutcome>
Expand description

Validate Markdown edited with $EDITOR, apply permitted fields to PBI id, and save it.

Only title, points, labels, assignee, sprint, parent, and the body are editable. pinto retains id, status, rank, depends_on, and timestamps; use move, reorder, and dep to change the managed fields.

Validate everything before saving, so invalid edits do not change on-disk state. Syntax errors and empty titles return Error::EditorInvalid; a missing parent returns Error::NotFound; a cyclic parent returns Error::ParentCycle. If no editable field changes, return EditOutcome::Unchanged without updating the timestamp.