Files
Tsering Paljor cd228facde fix: remove workflow name unique constraint and fix workflow ordering (#5000)
* Fix the URL for ordering workflows.

* Remove unique constraint on workflow name

* Add changelog

* Regenerate migrations + standardize naming

* Fix tests

* Fix test
2026-03-27 17:39:11 +07:00

36 lines
1.0 KiB
JavaScript

export default (client) => {
return {
create(automationId, name) {
return client.post(`automation/${automationId}/workflows/`, {
name,
})
},
read(workflowId) {
return client.get(`automation/workflows/${workflowId}/`)
},
getHistory(workflowId) {
return client.get(`automation/workflows/${workflowId}/history/`)
},
update(workflowId, values) {
return client.patch(`automation/workflows/${workflowId}/`, values)
},
delete(workflowId) {
return client.delete(`automation/workflows/${workflowId}/`)
},
order(automationId, order) {
return client.post(`/automation/${automationId}/workflows/order/`, {
workflow_ids: order,
})
},
duplicate(workflowId) {
return client.post(`/automation/workflows/${workflowId}/duplicate/async/`)
},
publish(workflowId) {
return client.post(`/automation/workflows/${workflowId}/publish/async/`)
},
testRun(workflowId) {
return client.post(`/automation/workflows/${workflowId}/test/`)
},
}
}