From 8daf68f9764309ade109f6cd9a0f4cd28e6d86dc Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Mon, 13 Apr 2020 14:58:37 +0200 Subject: [PATCH] docs: fix upload models name Signed-off-by: Jim LAURIE --- docs/3.0.0-beta.x/concepts/services.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/3.0.0-beta.x/concepts/services.md b/docs/3.0.0-beta.x/concepts/services.md index ee7d2da7c2..1e737d0f12 100644 --- a/docs/3.0.0-beta.x/concepts/services.md +++ b/docs/3.0.0-beta.x/concepts/services.md @@ -137,12 +137,13 @@ module.exports = { */ async create(data, { files } = {}) { - const entry = await strapi.query(model).create(data); + const entry = await strapi.query('restaurant').create(data); if (files) { // automatically uploads the files based on the entry and the model await strapi.entityService.uploadFiles(entry, files, { - model: strapi.models.restaurant, + model: 'restaurant', + // if you are using a plugin's model you will have to add the `plugin` key (plugin: 'users-permissions') }); return this.findOne({ id: entry.id }); } @@ -167,12 +168,13 @@ module.exports = { */ async update(params, data, { files } = {}) { - const entry = await strapi.query(model).update(params, data); + const entry = await strapi.query('restaurant').update(params, data); if (files) { // automatically uploads the files based on the entry and the model await strapi.entityService.uploadFiles(entry, files, { - model: strapi.models.restaurant, + model: 'restaurant, + // if you are using a plugin's model you will have to add the `plugin` key (plugin: 'users-permissions') }); return this.findOne({ id: entry.id }); }