Skip to main content

try_leave

Function try_leave 

Source
pub async fn try_leave(
    db: &SqlitePool,
    group_id: Uuid,
    user_id: Uuid,
) -> Result<bool, Error>
Expand description

Atomically remove the calling user from a group. If the caller is an owner the delete only fires when at least one other owner exists, so two concurrent leaves by the last two owners cannot both succeed. Returns true if a row was deleted.

ยงErrors

Returns Error::Database on delete failure.