From 8254aca5f2fc2d16be2d0ebf05a3402675c4a245 Mon Sep 17 00:00:00 2001 From: Simon Appelt Date: Wed, 23 Sep 2020 18:35:16 +0200 Subject: [PATCH] Bugfix to last commit --- docs/v3.x/concepts/services.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/v3.x/concepts/services.md b/docs/v3.x/concepts/services.md index 7dca8438cc..a5c3c405df 100644 --- a/docs/v3.x/concepts/services.md +++ b/docs/v3.x/concepts/services.md @@ -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