mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 15:13:21 +00:00
Bugfix to last commit
This commit is contained in:
parent
c9fe16d38c
commit
8254aca5f2
@ -139,7 +139,7 @@ module.exports = {
|
||||
*/
|
||||
|
||||
async create(data, { files } = {}) {
|
||||
const validData = await entityValidator.validateEntity(strapi.models.restaurant, data);
|
||||
const validData = await strapi.entityValidator.validateEntity(strapi.models.restaurant, data);
|
||||
const entry = await strapi.query('restaurant').create(validData);
|
||||
|
||||
if (files) {
|
||||
@ -171,8 +171,8 @@ module.exports = {
|
||||
*/
|
||||
|
||||
async update(params, data, { files } = {}) {
|
||||
const validData = await entityValidator.validateEntity(strapi.models.restaurant, data);
|
||||
const entry = await strapi.query('restaurant').create(validData);
|
||||
const validData = await strapi.entityValidator.validateEntityUpdate(strapi.models.restaurant, data);
|
||||
const entry = await strapi.query('restaurant').update(params, validData);
|
||||
|
||||
if (files) {
|
||||
// automatically uploads the files based on the entry and the model
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user