use reqwest::Method;
use crate::client::SearchcraftClient;
use crate::config::Operation;
use crate::error;
impl SearchcraftClient {
pub async fn commit_transaction(&self, index_name: &str) -> error::Result<String> {
let path = format!("index/{index_name}/commit");
self.transport
.request_data(Method::POST, &path, Operation::Write, None::<&()>)
.await
}
pub async fn rollback_transaction(&self, index_name: &str) -> error::Result<String> {
let path = format!("index/{index_name}/rollback");
self.transport
.request_data(Method::POST, &path, Operation::Write, None::<&()>)
.await
}
}