Skip to main content

delete

Function delete 

Source
pub async fn delete(
    pool: &Pool,
    taxonomy_id: i64,
    id: i64,
    reparent: bool,
) -> Result<usize, CategoryError>
Expand description

Delete a category. With children: reparent = true promotes them to the category’s own parent; otherwise the delete is rejected (CategoryError::HasChildren). Page↔category assignments are cleaned by crate::category::assign::delete_for_category_tx. Returns 1.

§Errors

CategoryError::HasChildren (children + not reparenting), NotFound, or DB failure.