Skip to content

Conversation

@Amitkanswal
Copy link
Contributor

Changes-

  • refactored changes for api adapter
  • refactored error handling logic

@Amitkanswal Amitkanswal requested a review from a team as a code owner April 1, 2025 06:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the API adapter and error handling logic to support improved error hosting while extending endpoint configuration.

  • Refactored API adapter functions and error handling in axios utilities.
  • Updated region handling and introduced endpoint configurations in UI location and type definitions.
  • Adjusted tests to cover the new endpoints and region behavior.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/utils/utils.ts Added sanitizeResponseHeader and handleApiError functions for improved error handling.
src/utils/adapter.ts Updated dispatchAdapter and dispatchApiRequest to leverage new error handling.
src/uiLocation.ts Integrated endpoints property and updated region typing.
src/types/api.type.ts & src/types.ts Extended type definitions to support endpoints and additional region values.
test/* Updated tests to require endpoints and new region behavior.
Comments suppressed due to low confidence (1)

src/types.ts:259

  • [nitpick] Ensure that the newly introduced enum value 'GCP_EU' is consistent with the existing naming conventions and intended region identifiers throughout the codebase.
GCP_EU = "GCP_EU",

@Amitkanswal Amitkanswal requested a review from Copilot April 2, 2025 12:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the API adapter and error handling logic to improve error processing and support for dynamic endpoints.

  • Refactored utility functions to include a header conversion helper and update region formatting.
  • Enhanced error handling in the API adapter to standardize error responses.
  • Updated tests and type definitions to incorporate new endpoints and region types.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/utils/utils.ts Added a header conversion function and updated region formatting.
src/utils/adapter.ts Refactored error handling with improved error response formation.
src/uiLocation.ts Integrated new endpoints and adjusted region type usage.
src/types/api.type.ts Added a new type definition for Contentstack endpoints.
src/types.ts Updated region definitions and type usage for region-related values.
test/* Updated and added tests to align with the new region and endpoint changes.

@Amitkanswal Amitkanswal merged commit 77e7812 into develop Apr 4, 2025
6 checks passed
@Amitkanswal Amitkanswal deleted the feat/MKT-11337-error-hosting-support branch April 4, 2025 05:40
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.

3 participants