Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions __tests__/httpServer/apiV1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ describe('HTTP Server API V1', () => {
test.todo('should return 500 for internal server error')
})

describe('POST /api/v1/workflow/:id/run', () => {
describe('POST /api/v1/workflow/:id/execute', () => {
let workflowSpy
let mockWorkflowFn

Expand Down Expand Up @@ -191,7 +191,7 @@ describe('HTTP Server API V1', () => {
test('should return 202 and run the specified workflow', async () => {
mockWorkflowFn.mockResolvedValueOnce()
const response = await app
.post('/api/v1/workflow/test-workflow/run')
.post('/api/v1/workflow/test-workflow/execute')
.set('Content-Type', 'application/json')
.send({ data: { some: 'data' } })

Expand All @@ -208,7 +208,7 @@ describe('HTTP Server API V1', () => {
workflowsList: []
})
const response = await app
.post('/api/v1/workflow/invalid-workflow/run')
.post('/api/v1/workflow/invalid-workflow/execute')
.set('Content-Type', 'application/json')
.send({})

Expand All @@ -231,7 +231,7 @@ describe('HTTP Server API V1', () => {
workflowsList: [{ id: 'test-workflow', description: 'Test workflow', isEnabled: false, isRequiredAdditionalData: false }]
})
const response = await app
.post('/api/v1/workflow/test-workflow/run')
.post('/api/v1/workflow/test-workflow/execute')
.set('Content-Type', 'application/json')
.send({})

Expand All @@ -254,7 +254,7 @@ describe('HTTP Server API V1', () => {
workflowsList: [{ id: 'test-workflow', description: 'Test workflow', isEnabled: true, isRequiredAdditionalData: true }]
})
const response = await app
.post('/api/v1/workflow/test-workflow/run')
.post('/api/v1/workflow/test-workflow/execute')
.set('Content-Type', 'application/json')
.send({})

Expand All @@ -266,7 +266,7 @@ describe('HTTP Server API V1', () => {
mockWorkflowFn.mockRejectedValueOnce(new Error('Something went wrong'))

const response = await app
.post('/api/v1/workflow/test-workflow/run')
.post('/api/v1/workflow/test-workflow/execute')
.set('Content-Type', 'application/json')
.send({ data: { some: 'data' } })

Expand Down
2 changes: 1 addition & 1 deletion src/httpServer/routers/apiV1.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function createApiRouter (knex, express) {
}
})

router.post('/workflow/:id/run', async (req, res) => {
router.post('/workflow/:id/execute', async (req, res) => {
const { id } = req.params
const { data } = req.body
const { workflows } = getWorkflowsDetails()
Expand Down
2 changes: 1 addition & 1 deletion src/httpServer/swagger/api-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/v1/workflow/{workflowId}/run:
/api/v1/workflow/{workflowId}/execute:
post:
summary: Execute a workflow
description: Executes the specified workflow with the provided input data
Expand Down
Loading