<in-parameters>
<parameter name="emojis" type="List">
<parameter name="emoji">
<parameter name="emojiName"/>
<parameter name="contentFile" type="org.apache.commons.fileupload.FileItem" />
</parameter>
</parameter>
</in-parameters>
I have created a service in moqui. The service takes an array of emoji files and emoji name. I am using React for frontend. So to pass the data from react I need to use formData and JSON.stringify because I am passing an array of objects. The problem is since I am using JSON.stringyfy how can I parse the data in backend without using any 2rd party packages? or is there any other way to pass the data without using stringify?
here is the frontend code:
const formData = new FormData();
const emojis = [
{
emojiName: ':ABC:',
contentFile: file,
},
];
formData.append('emojis', JSON.stringify(emojis));
return Api.channels.createChannelSubscription(formData);