Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GEN-2208]: fix destination field handling for "multi input" (#2188)
This pull request includes changes to improve the handling and parsing of JSON data in the dynamic fields and form data for destinations in the frontend web application. The most important changes include adding the `safeJsonParse` utility function to handle JSON parsing safely and refactoring the components to use this function. Improvements to JSON parsing: * [`frontend/webapp/containers/main/destinations/destination-form-body/dynamic-fields/index.tsx`](diffhunk://#diff-c17889e1ffea148a206f57df5da9f8cc755e7e522a9057a339f6887c01ed5815L3-R3): Added the `safeJsonParse` utility function to the imports. * [`frontend/webapp/containers/main/destinations/destination-form-body/dynamic-fields/index.tsx`](diffhunk://#diff-c17889e1ffea148a206f57df5da9f8cc755e7e522a9057a339f6887c01ed5815L34-R52): Updated the `InputList` and `KeyValueInputsList` components to use `safeJsonParse` for safely parsing JSON values. Refactoring: * [`frontend/webapp/hooks/destinations/useDestinationFormData.ts`](diffhunk://#diff-74e478b5171cbecdf7abf376e9bc1428c38d585bc6252dc463216f9869bf9f77L36-L50): Removed redundant parsing logic for `MULTI_INPUT` component type, simplifying the code. * [`frontend/webapp/hooks/destinations/useDestinationFormData.ts`](diffhunk://#diff-74e478b5171cbecdf7abf376e9bc1428c38d585bc6252dc463216f9869bf9f77R107-R108): Added a console log statement to debug the parsed fields in the `useDestinationFormData` function.
- Loading branch information