Add working test workflow button

This commit is contained in:
Andrew Kingston 2020-09-14 09:33:18 +01:00
parent d13a597ed2
commit e79d4f11c9
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"
}