Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

386 B
Raw Blame
/// Removes the user's role
#[tracing::instrument(skip(db))]
pub async fn remove_user_role(
    db: sqlx::Pool<sqlx::Postgres>,
    user_id: &str,
    role: &str,
) -> anyhow::Result<()> {
    sqlx::query!(
        r#"
        DELETE FROM "RolesOnUsers" WHERE "userId" = $1 AND "roleId" = $2
        "#,
        user_id,
        role,
    )
    .execute(&db)
    .await?;

    Ok(())
}