My dilemma lies in the data I have uploaded under the _attachments
variable:
https://i.sstatic.net/jnFNH.png
My aim is to format this data for insertion in the following structure:
"_attachments": [
{
"container": "string",
"fileName": "string",
"name": "string",
"mime": "string",
"size": 0
}
]
However, my current approach has been:
for (let key in _attachments) {
job._attachments[key]['container'] = _attachments[key]['container'];
job._attachments[key]['fileName'] = _attachments[key]['fileName'];
job._attachments[key]['name'] = _attachments[key]['name'];
job._attachments[key]['mime'] = _attachments[key]['mime'];
job._attachments[key]['size'] = _attachments[key]['size'];
}
This method resulted in the following error:
Unprocessable Entity
Please note that I am utilizing loopback in this scenario.