I'm trying to create an entry in strapi, that contains field of type media.
Now I'm using code provided in documentation. But, in fact, it is creating an entry, and then adding file to it. So media field cant't be made required.
async create(data, { files } = {}) {
const entry = await strapi.query(model).create(data);
if (files) {
await this.uploadFiles(entry, files, { model });
return this.findOne({ id: entry.id });
}
return entry;
}
I would like to create an entry in single request. Is it possible?
from Is there any way to create an entry with media field in strapi?
No comments:
Post a Comment