- **Strapi Version STRAPI V4
When creating an entry on an api with postman i am able to hit the media single component:
sending data like this:
{
“data”: {
“project”: 23,
“media”: { “path”: “photos//c/cbgodpwd.png”, “file_type”: “photo” }
}
}
but when i use inside a controller this create method i am able to create the entry but the media object is not getting uploaded do i need to populate somehow?
const mediaData = {
data: {
project: parseInt(projectId),
media: {
path: fullPath,
file_type: media.file_type
},
},
};
const createdMedia = await strapi.query(‘api::photo.photo’).create(mediaData);