1
0
Fork 0
mirror of synced 2024-07-05 06:20:55 +12:00

Add working test workflow button

This commit is contained in:
Andrew Kingston 2020-09-14 09:33:18 +01:00
parent 71388f47a4
commit 757845c233
2 changed files with 9 additions and 1 deletions

View file

@ -68,6 +68,11 @@ const workflowActions = store => ({
return state
})
},
trigger: async ({ workflow }) => {
const { _id } = workflow
const TRIGGER_WORKFLOW_URL = `/api/workflows/${_id}/trigger`
return await api.post(TRIGGER_WORKFLOW_URL)
},
select: workflow => {
store.update(state => {
state.selectedWorkflow = new Workflow(cloneDeep(workflow))

View file

@ -28,7 +28,10 @@
notifier.info("Workflow block deleted.")
}
function testWorkflow() {
async function testWorkflow() {
const result = await workflowStore.actions.trigger({
workflow: $workflowStore.selectedWorkflow.workflow,
})
testResult = "Workflow passed"
}