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.

561 B
Raw Blame
use super::SyncServiceClient;
use anyhow::Result;
use reqwest::StatusCode;

impl SyncServiceClient {
    #[tracing::instrument(skip(self), err)]
    pub async fn exists(&self, document_id: &str) -> Result<bool> {
        let full_url = format!("{}/document/{}/exists", self.url, document_id);
        let res = self.client.head(&full_url).send().await?;

        let status_code = res.status();

        if status_code == StatusCode::NOT_FOUND {
            Ok(false)
        } else {
            res.error_for_status()?;
            Ok(true)
        }
    }
}