Skip to main content

update_notebook

Function update_notebook 

Source
pub async fn update_notebook(
    db: &Arc<dyn NotebookDb>,
    id: Uuid,
    user_id: Uuid,
    patch: NotebookUpdatePatch,
) -> Result<Option<Notebook>, NotebookError>
Expand description

Update a notebook’s name and/or cells.

Replicates Python’s truthiness-gated assignment:

  • name is only updated when patch.name is Some and non-empty.
  • cells is only updated when patch.cells is Some(Value::Array(v)) with v non-empty — an empty cells list does not clear cells.