Hello,
How to put a image file from external URL, during the creation of a type.
Example:
const { sanitizeEntity } = require('strapi-utils');
module.exports = {
async create(ctx) {
let entity;
const file = await axios.get('someImageUrl')
entity = await strapi.services.restaurant.create(data, file.data);
return sanitizeEntity(entity, { model: strapi.models.restaurant });
},
};
Thanks.