Enhancement: workflow overview toggle enable button (#7818)

This commit is contained in:
shamoon
2024-09-30 19:44:02 -07:00
committed by GitHub
parent 991c9b0ca4
commit 0b829cab32
4 changed files with 82 additions and 14 deletions

View File

@@ -130,4 +130,21 @@ export class WorkflowsComponent
})
})
}
onWorkflowEnableToggled(workflow: Workflow) {
this.workflowService.patch(workflow).subscribe({
next: () => {
this.toastService.showInfo(
workflow.enabled
? $localize`Enabled workflow`
: $localize`Disabled workflow`
)
this.workflowService.clearCache()
this.reload()
},
error: (e) => {
this.toastService.showError($localize`Error toggling workflow.`, e)
},
})
}
}