Implement the status and type filtering on the tasks route

This commit is contained in:
Kerollmops
2022-05-18 12:07:06 +02:00
parent 3684c822f1
commit 8509243e68
4 changed files with 185 additions and 11 deletions

View File

@ -131,6 +131,17 @@ impl Index<'_> {
self.service.get(url).await
}
pub async fn filtered_tasks(&self, type_: &[&str], status: &[&str]) -> (Value, StatusCode) {
let mut url = format!("/tasks?indexUid={}", self.uid);
if !type_.is_empty() {
url += &format!("&type={}", type_.join(","));
}
if !status.is_empty() {
url += &format!("&status={}", status.join(","));
}
self.service.get(url).await
}
pub async fn get_document(
&self,
id: u64,