Skip to content

Conversation

@AishDani
Copy link
Contributor

@AishDani AishDani commented Apr 2, 2025

++ added try-catch block in content mapper service of api
++ added missing await in putTestData call
++ removed static status code from content mapper controller and made it dynamic

@AishDani AishDani requested a review from a team as a code owner April 2, 2025 12:13
@sauravraw sauravraw requested a review from Copilot April 2, 2025 12:15
Copy link
Contributor

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 enhances the content mapper flow in both the API and UI layers by introducing error handling, ensuring proper asynchronous behavior, and making response status codes dynamic.

  • Added try-catch blocks and error propagation in the content mapper service.
  • Fixed a missing await in the putTestData call for consistent asynchronous updates.
  • Updated controller responses to use dynamic status codes instead of a static value.

Reviewed Changes

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

Show a summary per file
File Description
upload-api/src/services/contentful/index.ts Updated axios response destructuring and validation of content_mapper.
upload-api/src/controllers/wordpress/index.ts Replaced response handling via destructuring to determine dynamic status.
upload-api/src/controllers/sitecore/index.ts Removed safe navigation from axios call and updated destructuring of response.
ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx Added state update callbacks to remove specific options from selection and updated deletion logic.
api/src/services/contentMapper.service.ts Wrapped multiple service functions in try-catch blocks, fixed asynchronous writes, and returned dynamic status in responses.
api/src/controllers/projects.contentMapper.controller.ts Updated controller responses to use dynamic status codes from the service layer.
Comments suppressed due to low confidence (1)

ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx:240

  • [nitpick] The inline comment refers to 'csLocale' while the variable in use is 'locale'. Update the comment to accurately reflect the variable name.
          (item) => item !== locale // Remove the item equal to csLocale

getLogMessage(
srcFunc,
`${HTTP_TEXTS.CONTENT_TYPE_NOT_FOUND} Id: ${contentTypeId}`
"Error occurred while while getting field mapping of projects",
Copy link

Copilot AI Apr 2, 2025

Choose a reason for hiding this comment

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

The error log message contains a duplicate 'while'. Removing one occurrence would improve clarity.

Suggested change
"Error occurred while while getting field mapping of projects",
"Error occurred while getting field mapping of projects",

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved the comments

@sayalijoshi27 sayalijoshi27 merged commit 36f799d into dev Apr 2, 2025
4 of 5 checks passed
umeshmore45 pushed a commit that referenced this pull request Jun 11, 2025
AishDani pushed a commit that referenced this pull request Jul 26, 2025
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