Currently, when I submit a redux-form, and send the data-transfer-object to the backend, there is a backend object that accepts the data and creates an object (I am using Spring Boot Framework in the backend). One example is, if my form contains the following:
Name: _____________
Address: _____________
Age: _____________
I have a backend DTO object Person that has these fields:
String name;
String Address;
int age;
Spring is smart enough that if I define the request body as a Person Object, that it will take the values entered by the user and create the Object for me to use in my receiving API endpoint. (Again this is just an example). In my real problem, I have to add a new field called LocationCode. As I currently have it designed, users will add all of their location codes as a comma separated list. This is just one field on the UI that is labeled Location Code. So a possible value could be "loc1, location 2, myLocation" and the corresponding backend will have a LocationCode variable to store this string.
However I have a new requirement to create a new field for every location code the user wants to input ( The front end is all set). I can create as many of these as I want in the frontend and the user can have
Location Code 1 _____________
Location Code 2 _____________
....
Location Code x _____________
My problem is, my backend cant have a random number of fields. Is there some way to take all of these user inputs, and combine them into one string to pass back to the Spring Backend so I can still end up with a comma separated string. This way I can still only have the one field in the backend?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)