Merge pull request #14842 from Budibase/BUDI-8723/new-automation-not-selected-upon-creation

Navigate to automation on creation
This commit is contained in:
Adria Navarro 2024-10-22 16:48:34 +02:00 committed by GitHub
commit b7e34f7f83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,5 @@
<script>
import { goto } from "@roxi/routify"
import { automationStore } from "stores/builder"
import {
notifications,
@ -32,11 +33,12 @@
triggerVal.stepId,
triggerVal
)
await automationStore.actions.create(name, trigger)
const automation = await automationStore.actions.create(name, trigger)
if (triggerVal.stepId === TriggerStepID.WEBHOOK) {
webhookModal.show()
}
notifications.success(`Automation ${name} created`)
$goto(`../automation/${automation._id}`)
} catch (error) {
notifications.error("Error creating automation")
}