Images uploaded but not attached

Hi guys,
i have the following code trying to upload images to the Post collection and attach to the repeatable component called “images” with structure [‘image’,‘caption’].

Post collection has fields: long_text (text), profile (ID ref), images (component repeatable)

The images I upload are uploaded correctly but they are not attached to the newly created Post. Can you advise?

Here is the code (I attach image to let you visualise part of the collection fields):

let formdata = new FormData();
//formdata.append(“long_text”, largeTxt)
formdata.append(‘data’, JSON.stringify({“long_text”: largeTxt,‘profile’:userData.user.profiles[0].id}));
postImage.map((item,index) =>(
formdata.append(files.images[${index}].image, {
uri: item.path,
type: item.mime,
name: ${Date.now()}${item.path.substr(item.path.lastIndexOf('.'))},
})
))
//formdata.append(‘profile’,userData.user.profiles[0].id)
console.log(‘formdata’,formdata)
const res = await apiCall(
“POST”,
ApiEndPoints.CreatePost,
formdata,
{
‘Content-Type’: ‘multipart/form-data’,
‘Authorization’:‘bearer’+’ '+userData.jwt
}
);

Hello guys, any idea about this? or any known issue why the request uploads the images correctly but they are not attached to the component???

Hey, did you find any solution for this? and if yes, what’s your final code

Nobody helped so no solution :frowning: I upload the assets first and then i attach the returned ids to the final request…