Skip to main content

apply_relation_updates

Function apply_relation_updates 

Source
pub async fn apply_relation_updates<S: StorageAdapter>(
    storage: &S,
    class_name: &str,
    object_id: &str,
    updates: &[RelationUpdate],
) -> Result<(), ParseError>
Expand description

Apply membership changes, after the row write has succeeded.

handleRelationUpdates (DatabaseController.js:769-830). An add is an upsert, so adding a user to a role twice is one membership. A remove that matches nothing is not an error: upstream swallows OBJECT_NOT_FOUND (:823-829).