Skip to content

Commit

Permalink
Improved error resilience and clarity in handling Jira search operati…
Browse files Browse the repository at this point in the history
…ons by introducing structured TypeScript type definitions and enhancing the searchJira function to return both search results and HTTP status codes

Signed-off-by: enaysaa [email protected]

Introduced TypeScript type definitions SearchJiraResponse and JiraQueryResults to represent Jira search responses and pagination details.
Updated the searchJira function to return search results as a SearchJiraResponse, incorporating the new types.
Enhanced error handling in the searchJira function by handling HTTP response errors and logging them appropriately.
The JiraQueryResults type outlines the structure of a paginated Jira search response, facilitating better data handling.
These changes streamline the Jira Dashboard plugin's codebase, improving error resilience and clarity in handling search operations.
  • Loading branch information
SaachiNayyer committed Oct 30, 2024
1 parent ca952da commit 0766050
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions plugins/jira-dashboard-backend/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,7 @@ export const searchJira = async (
instance: ConfigInstance,
jqlQuery: string,
options: SearchOptions,
<<<<<<< HEAD
): Promise<JiraQueryResults> => {
=======
): Promise<Issue[]> => {
>>>>>>> 39b1dbf (Add support for multiple Jira instances (#202))
const response = await fetch(`${instance.baseUrl}search`, {
method: 'POST',
body: JSON.stringify({ jql: jqlQuery, ...options }),
Expand Down

0 comments on commit 0766050

Please sign in to comment.