Skip to content

Conversation

@hentrymartin
Copy link
Collaborator

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/PM-2540

What's in this PR?

  • Added ai workflow list component to create or update default reviewer
  • Sends the selected ai workflow id to backend

const options = workflows.map((wf: { id: string; name: string }) => ({ label: wf.name, value: wf.id }))
setAiWorkflows(options)
})
}, [])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Consider adding error handling for the getAiWorkflows promise to manage potential failures, such as network issues or server errors. This will improve the robustness of the component.

/>
</div>
<div className={styles.inputField}>
{!isMemberReview && (
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Ensure that the aiWorkflowId field is correctly reset when defaultReviewerInfo changes, especially if isMemberReview is toggled. This prevents stale data from being displayed or submitted.

}

export async function getAiWorkflows(): Promise<AiWorkflow[]> {
const response = await xhrGetAsync<AiWorkflow[]>(`${EnvironmentConfig.API.V6}/workflows`)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
Consider adding error handling for the xhrGetAsync call to manage potential network or server errors gracefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants