From 16b31c3e358ddd138e48e66888a8cc629a01c3cc Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Sun, 11 Aug 2024 15:14:19 +0530 Subject: [PATCH] Refresh automation data shown by edit automation card after update Previously required the automation page to be refreshed to see updates to the automation in the edit automation card. This would be seen when user tries to edit an automation multiple times (without a page refresh) --- src/interface/web/app/automations/page.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/interface/web/app/automations/page.tsx b/src/interface/web/app/automations/page.tsx index 51acae08..b6acd6a2 100644 --- a/src/interface/web/app/automations/page.tsx +++ b/src/interface/web/app/automations/page.tsx @@ -324,7 +324,7 @@ function AutomationsCard(props: AutomationsCardProps) { setNewAutomationData={setUpdatedAutomationData} authenticatedData={props.authenticatedData} isCreating={isEditing} - automation={automation} + automation={updatedAutomationData || automation} ipLocationData={props.locationData} /> )} @@ -500,19 +500,14 @@ function EditCard(props: EditCardProps) { ); let updateQueryUrl = `/api/automation?`; - updateQueryUrl += `q=${values.queryToRun}`; - if (automation?.id && !props.createNew) { updateQueryUrl += `&automation_id=${automation.id}`; } - if (values.subject) { updateQueryUrl += `&subject=${values.subject}`; } - updateQueryUrl += `&crontime=${cronFrequency}`; - if (props.locationData) { updateQueryUrl += `&city=${props.locationData.city}`; updateQueryUrl += `®ion=${props.locationData.region}`; @@ -978,7 +973,6 @@ export default function Automations() { const [suggestedAutomations, setSuggestedAutomations] = useState([]); const [showLoginPrompt, setShowLoginPrompt] = useState(false); const isMobileWidth = useIsMobileWidth(); - const ipLocationData = useIPLocationData(); useEffect(() => {