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.

1.0 KB
Raw Blame
use crate::api::ApiContext;
use axum::Router;
use axum::routing::{get, post};

pub(crate) mod block_sender;
pub(crate) mod list;
pub(crate) mod list_blocked;
pub(crate) mod unblock_sender;

pub fn router(state: ApiContext) -> Router<ApiContext> {
    Router::new()
        .route("/", get(list::list_contacts_handler))
        .route(
            "/block",
            post(block_sender::handler).layer(axum::middleware::from_fn_with_state(
                state.clone(),
                crate::api::middleware::link::attach_link_context,
            )),
        )
        .route(
            "/unblock",
            post(unblock_sender::handler).layer(axum::middleware::from_fn_with_state(
                state.clone(),
                crate::api::middleware::link::attach_link_context,
            )),
        )
        .route(
            "/blocked",
            get(list_blocked::handler).layer(axum::middleware::from_fn_with_state(
                state,
                crate::api::middleware::link::attach_link_context,
            )),
        )
}