task v2 refactor part 9: ObserverTask -> TaskV2 in frontend code (#1822)

This commit is contained in:
Shuchang Zheng
2025-02-28 00:00:59 -05:00
committed by GitHub
parent 14689b53e4
commit 2849a3dc6c
5 changed files with 12 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
import { getClient } from "@/api/AxiosClient";
import { ObserverTask } from "@/api/types";
import { TaskV2 } from "@/api/types";
import { toast } from "@/components/ui/use-toast";
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
import { ReloadIcon } from "@radix-ui/react-icons";
@@ -23,10 +23,9 @@ function ExampleCasePill({ exampleId, version, icon, label, prompt }: Props) {
const startObserverCruiseMutation = useMutation({
mutationFn: async (prompt: string) => {
const client = await getClient(credentialGetter, "v2");
return client.post<{ user_prompt: string }, { data: ObserverTask }>(
"/tasks",
{ user_prompt: prompt },
);
return client.post<{ user_prompt: string }, { data: TaskV2 }>("/tasks", {
user_prompt: prompt,
});
},
onSuccess: (response) => {
toast({