Allow querying multiple statuses (#232)

This commit is contained in:
Salih Altun
2024-04-24 22:27:15 +03:00
committed by GitHub
parent 1d329539e4
commit 95f8ad191b
3 changed files with 10 additions and 7 deletions

View File

@@ -46,12 +46,15 @@ function TaskList() {
} = useQuery<Array<TaskApiResponse>>({
queryKey: ["tasks", "all", page],
queryFn: async () => {
const params = new URLSearchParams();
params.append("page", String(page));
params.append("page_size", String(PAGE_SIZE));
params.append("task_status", "completed");
params.append("task_status", "failed");
params.append("task_status", "terminated");
return client
.get("/tasks", {
params: {
page,
page_size: PAGE_SIZE,
},
params,
})
.then((response) => response.data);
},