From dbaf04286acd2d7b65cd322f601abc12a6fb2960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20de=20Juvigny?= Date: Fri, 7 Aug 2020 15:56:29 +0200 Subject: [PATCH 1/2] Fix local upload provider docs --- packages/strapi-provider-upload-local/README.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/strapi-provider-upload-local/README.md b/packages/strapi-provider-upload-local/README.md index 196c089739..eee3114954 100644 --- a/packages/strapi-provider-upload-local/README.md +++ b/packages/strapi-provider-upload-local/README.md @@ -2,7 +2,7 @@ ## Configurations -Your configuration is passed down to the cloudinary configuration. (e.g: `cloudinary.config(config)`). You can see the complete list of options [here](https://cloudinary.com/documentation/cloudinary_sdks#configuration_parameters) +This provider has only one parameter: `sizeLimit`. **Example** @@ -10,14 +10,14 @@ Your configuration is passed down to the cloudinary configuration. (e.g: `cloudi ```json { - "provider": "cloudinary", + "provider": "local", "providerOptions": { "sizeLimit": 100000 } } ``` -The `sizeLimit` parameter must be a number. Be aware that the unit is in KB. When setting this value high, you should make sure to also configure the body parser middleware `maxFileSize` so the file can be sent and processed. Read more [here](https://strapi.io/documentation/v3.x/plugins/upload.html#configuration) +The `sizeLimit` parameter must be a number. Be aware that the unit is in bytes, and the default is 1000000. When setting this value high, you should make sure to also configure the body parser middleware `maxFileSize` so the file can be sent and processed. Read more [here](https://strapi.io/documentation/v3.x/plugins/upload.html#configuration) ## Resources @@ -28,7 +28,3 @@ The `sizeLimit` parameter must be a number. Be aware that the unit is in KB. Whe - [Strapi website](http://strapi.io/) - [Strapi community on Slack](http://slack.strapi.io) - [Strapi news on Twitter](https://twitter.com/strapijs) - -``` - -``` From 1cc74ca6a04efc8f9f825cab5b7923de2eb4dc31 Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Mon, 10 Aug 2020 15:19:28 +0200 Subject: [PATCH 2/2] Fix virtual mongoose remove _v char Signed-off-by: Alexandre Bodin --- packages/strapi-connector-mongoose/lib/mount-models.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/strapi-connector-mongoose/lib/mount-models.js b/packages/strapi-connector-mongoose/lib/mount-models.js index 0724a951f0..9d907e728c 100644 --- a/packages/strapi-connector-mongoose/lib/mount-models.js +++ b/packages/strapi-connector-mongoose/lib/mount-models.js @@ -115,11 +115,9 @@ module.exports = ({ models, target }, ctx) => { // Add virtual key to provide populate and reverse populate _.forEach( - _.pickBy(definition.loadedModel, model => { - return model.type === 'virtual'; - }), + _.pickBy(definition.loadedModel, ({ type }) => type === 'virtual'), (value, key) => { - schema.virtual(key.replace('_v', ''), { + schema.virtual(key, { ref: value.ref, localField: '_id', foreignField: value.via,