Skip to content

Commit

Permalink
better route naming convention (#6065)
Browse files Browse the repository at this point in the history
Co-authored-by: Yohann Paris <[email protected]>
  • Loading branch information
mwdchang and YohannParis authored Jan 15, 2025
1 parent 609a663 commit 40b47f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions packages/client/hmi-client/src/services/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -886,21 +886,21 @@ export const newOperator = (

export const selectOutput = async (id: string, nodeId: string, outputId: string, projectId?: string) => {
console.log('>> workflowService.selectOutput');
const response = await API.post(`/workflows/${id}/select-output/${nodeId}/${outputId}`, {
const response = await API.post(`/workflows/${id}/node/${nodeId}/selected-output/${outputId}`, {
params: { 'project-id': projectId }
});
return response.data ?? null;
};

export const appendOutput = async (id: string, nodeId: string, output: WorkflowOutput<any>, nodeState: any) => {
console.log('>> workflowService.appendOutput');
const response = await API.post(`/workflows/${id}/append-output/${nodeId}`, { output, nodeState });
const response = await API.post(`/workflows/${id}/node/${nodeId}/output`, { output, nodeState });
return response.data ?? null;
};

export const appendInput = async (id: string, nodeId: string, input: WorkflowPort) => {
console.log('>> workflowService.appendInput');
const response = await API.post(`/workflows/${id}/append-input/${nodeId}`, input);
const response = await API.post(`/workflows/${id}/node/${nodeId}/input`, input);
return response.data ?? null;
};

Expand All @@ -916,6 +916,9 @@ export const addEdge = async (id: string, edge: WorkflowEdge) => {
return response.data ?? null;
};

/// /////////////////////////////////////////////////////////////////////////////
// Bulk API actions
/// /////////////////////////////////////////////////////////////////////////////
export const removeNodes = async (id: string, nodeIds: string[]) => {
console.log('>> workflowService.removeNode', nodeIds);
const response = await API.post(`/workflows/${id}/remove-nodes`, nodeIds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public ResponseEntity<ResponseDeleted> deleteWorkflow(
return ResponseEntity.ok(new ResponseDeleted("Workflow", id));
}

@PostMapping("/{id}/select-output/{nodeId}/{outputId}")
@PostMapping("/{id}/node/{nodeId}/selected-output/{outputId}")
@Secured(Roles.USER)
@Operation(summary = "Select an operator output to use")
@ApiResponses(
Expand Down Expand Up @@ -423,7 +423,7 @@ static class AppendOutputPayload {
private JsonNode nodeState;
}

@PostMapping("/{id}/append-input/{nodeId}")
@PostMapping("/{id}/node/{nodeId}/input")
@Secured(Roles.USER)
@Operation(summary = "Append an input port to an operator node")
@ApiResponses(
Expand Down Expand Up @@ -469,7 +469,7 @@ public ResponseEntity<Workflow> appendInput(
return updated.map(ResponseEntity::ok).orElseGet(() -> ResponseEntity.notFound().build());
}

@PostMapping("/{id}/append-output/{nodeId}")
@PostMapping("/{id}/node/{nodeId}/output")
@Secured(Roles.USER)
@Operation(summary = "Append an output to an operator node")
@ApiResponses(
Expand Down

0 comments on commit 40b47f0

Please sign in to comment.