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.

499 B
Raw Blame
/// Gets all invited users in a given organization
#[tracing::instrument(skip(db))]
pub async fn get_invited_users_by_organization(
    db: sqlx::Pool<sqlx::Postgres>,
    organization_id: i32,
) -> anyhow::Result<Vec<String>> {
    let emails = sqlx::query!(
        r#"
        SELECT
            oi.email
        FROM "OrganizationInvitation" oi
        WHERE oi.organization_id = $1
    "#,
        organization_id,
    )
    .map(|r| r.email)
    .fetch_all(&db)
    .await?;

    Ok(emails)
}