-
Notifications
You must be signed in to change notification settings - Fork 8
Feature/dropdown field choices #585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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", |
Copilot
AI
Apr 2, 2025
There was a problem hiding this comment.
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.
| "Error occurred while while getting field mapping of projects", | |
| "Error occurred while getting field mapping of projects", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved the comments
…r into feature/dropdown-field-choices
Feature/dropdown field choices
Feature/dropdown field choices
++ 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