From c643472f3c2f8a01f02520719eacca9ac5ee042b Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Wed, 20 Nov 2024 07:48:07 -0800 Subject: [PATCH] Fetch less in workflows page (#1226) --- skyvern-frontend/src/routes/workflows/WorkflowActions.tsx | 8 +++----- skyvern-frontend/src/routes/workflows/Workflows.tsx | 5 +++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/skyvern-frontend/src/routes/workflows/WorkflowActions.tsx b/skyvern-frontend/src/routes/workflows/WorkflowActions.tsx index ffeb5aca..45e3b4ff 100644 --- a/skyvern-frontend/src/routes/workflows/WorkflowActions.tsx +++ b/skyvern-frontend/src/routes/workflows/WorkflowActions.tsx @@ -34,12 +34,11 @@ import { AxiosError } from "axios"; import { useNavigate } from "react-router-dom"; import { stringify as convertToYAML } from "yaml"; import { convert } from "./editor/workflowEditorUtils"; -import { useWorkflowQuery } from "./hooks/useWorkflowQuery"; import { WorkflowApiResponse } from "./types/workflowTypes"; import { WorkflowCreateYAMLRequest } from "./types/workflowYamlTypes"; type Props = { - id: string; + workflow: WorkflowApiResponse; }; function downloadFile(fileName: string, contents: string) { @@ -58,10 +57,9 @@ function downloadFile(fileName: string, contents: string) { document.body.removeChild(element); } -function WorkflowActions({ id }: Props) { +function WorkflowActions({ workflow }: Props) { const credentialGetter = useCredentialGetter(); const queryClient = useQueryClient(); - const { data: workflow } = useWorkflowQuery({ workflowPermanentId: id }); const navigate = useNavigate(); function handleExport(type: "json" | "yaml") { @@ -187,7 +185,7 @@ function WorkflowActions({ id }: Props) {