add error codes and tests

This commit is contained in:
Tamo 2023-05-02 20:03:45 +02:00
parent 441641397b
commit ed3dfbe729
No known key found for this signature in database
GPG key ID: 20CD8020AFA88D69
5 changed files with 195 additions and 5 deletions

View file

@ -140,6 +140,11 @@ impl Index<'_> {
}
}
pub async fn get_document_by_filter(&self, payload: Value) -> (Value, StatusCode) {
let url = format!("/indexes/{}/documents/fetch", urlencode(self.uid.as_ref()));
self.service.post(url, payload).await
}
pub async fn wait_task(&self, update_id: u64) -> Value {
// try several times to get status, or panic to not wait forever
let url = format!("/tasks/{}", update_id);