Skip to content

Commit 14ab0fd

Browse files
authored
chore: use to /api/v1/workflow/:id/execute (#10)
1 parent 61cd39c commit 14ab0fd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/__tests__/cli-commands.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ describe('CLI Commands', () => {
518518
it('should execute a workflow successfully', async () => {
519519
// Mock API call
520520
nock('http://localhost:3000')
521-
.post('/api/v1/workflow/update-stuff/run', { data: { projectId: 123 } })
521+
.post('/api/v1/workflow/update-stuff/execute', { data: { projectId: 123 } })
522522
.reply(202, workflowRunResponse)
523523

524524
// Execute the function
@@ -538,7 +538,7 @@ describe('CLI Commands', () => {
538538
it('Should execute a workflow that was unsuccessful', async () => {
539539
// Mock API call
540540
nock('http://localhost:3000')
541-
.post('/api/v1/workflow/update-stuff/run', { data: { projectId: 123 } })
541+
.post('/api/v1/workflow/update-stuff/execute', { data: { projectId: 123 } })
542542
.reply(202, { ...workflowRunResponse, status: 'failed', result: { message: 'Failed to execute workflow', success: false } })
543543

544544
// Execute the function
@@ -558,7 +558,7 @@ describe('CLI Commands', () => {
558558
it('should handle API errors gracefully', async () => {
559559
// Mock API error
560560
nock('http://localhost:3000')
561-
.post('/api/v1/workflow/invalid-workflow/run')
561+
.post('/api/v1/workflow/invalid-workflow/execute')
562562
.reply(404, { errors: [{ message: 'Workflow not found' }] } as APIErrorResponse)
563563

564564
// Execute the function
@@ -573,7 +573,7 @@ describe('CLI Commands', () => {
573573
it('should handle network errors gracefully', async () => {
574574
// Mock network error
575575
nock('http://localhost:3000')
576-
.post('/api/v1/workflow/update-stuff/run')
576+
.post('/api/v1/workflow/update-stuff/execute')
577577
.replyWithError('Network error')
578578

579579
// Execute the function

src/api-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export const getAllWorkflows = async (): Promise<APIWorkflowItem[]> => {
8383
export const runWorkflow = async (workflowId: string, data: any): Promise<APIWorkflowRunItem> => {
8484
const client = apiClient()
8585
const payload = data ? { data } : {}
86-
const response = await client.post(`workflow/${workflowId}/run`, {
86+
const response = await client.post(`workflow/${workflowId}/execute`, {
8787
json: payload,
8888
responseType: 'json'
8989
})

0 commit comments

Comments
 (0)