System Information
- Strapi Version: 3.5.1
- Operating System: Windows 10 64 bit
- Database: Postgres
- Node Version: 14.15.5
- NPM Version: 6.14.11
- Yarn Version: 1.21.1
I have a collection type “product-registration” which has a repeatable component “product_licenses” which has an image filed named license.
Now I have created a custom function which creates a product-registration entry then tries to upload images to the repeatable component.
I am not able to figure out the logic to achieve this.
const entity = await strapi.services[
'product-registration'
].create(input);
if (lis) {
// automatically uploads the files based on the entry and the model
await strapi.plugins.upload.services.upload.uploadToEntity({
id: entity.id || entity._id,
model: 'product-registration',
field: 'license',
source: 'product-registration'
}, lis);
}