From a8880b038a205e94f077b08f78ff9f38388fb2e2 Mon Sep 17 00:00:00 2001 From: enaysaa Date: Mon, 13 May 2024 16:12:00 +0100 Subject: [PATCH] Improved error resilience and clarity in handling Jira search operations by introducing structured TypeScript type definitions and enhancing the searchJira function to return both search results and HTTP status codes Signed-off-by: enaysaa saachi.nayyer@ericsson.com 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. --- plugins/jira-dashboard-backend/src/plugin.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/jira-dashboard-backend/src/plugin.ts b/plugins/jira-dashboard-backend/src/plugin.ts index 63543a0..1a05c38 100644 --- a/plugins/jira-dashboard-backend/src/plugin.ts +++ b/plugins/jira-dashboard-backend/src/plugin.ts @@ -24,6 +24,8 @@ export const jiraDashboardPlugin = createBackendPlugin({ userInfo: coreServices.userInfo, }, async init({ + auth, + httpRouter, auth, httpRouter, logger,