From 1282a5b4c004033e8891a2cd222c68a507a2105d Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Thu, 22 Nov 2018 20:27:52 +0100 Subject: [PATCH 1/3] Fix bookshelf query params fetch data --- .../strapi-plugin-users-permissions/services/Providers.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/strapi-plugin-users-permissions/services/Providers.js b/packages/strapi-plugin-users-permissions/services/Providers.js index 158674e7b9..2fc3d0e851 100644 --- a/packages/strapi-plugin-users-permissions/services/Providers.js +++ b/packages/strapi-plugin-users-permissions/services/Providers.js @@ -47,7 +47,10 @@ exports.connect = (provider, query) => { try { const users = await strapi.query('user', 'users-permissions').find({ where: { - email: profile.email + email: { + symbol: '=', + value: profile.email + } } }); From 2c2ed2984ab0727deeec5b7657345a7c7e3264e8 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Fri, 23 Nov 2018 15:09:16 +0100 Subject: [PATCH 2/3] Update bookshelf generateMatchStage --- packages/strapi-hook-bookshelf/lib/relations.js | 14 +++++++++++++- .../services/Providers.js | 5 +---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/strapi-hook-bookshelf/lib/relations.js b/packages/strapi-hook-bookshelf/lib/relations.js index 0b8695510c..f97818cdf4 100644 --- a/packages/strapi-hook-bookshelf/lib/relations.js +++ b/packages/strapi-hook-bookshelf/lib/relations.js @@ -53,10 +53,22 @@ module.exports = { if (!association) { const fieldKey = `${strapiModel.collectionName}.${key}`; if (_.isArray(value.value) && value.symbol !== 'IN') { - for (const value in value.value) { + for (let value in value.value) { + if (typeof value === 'string') { + value = { + value, + symbol: '=' + }; + } qb[value ? 'where' : 'orWhere'](fieldKey, value.symbol, value.value[value]); } } else { + if (typeof value === 'string') { + value = { + value, + symbol: '=' + }; + } qb.where(fieldKey, value.symbol, value.value); } } else { diff --git a/packages/strapi-plugin-users-permissions/services/Providers.js b/packages/strapi-plugin-users-permissions/services/Providers.js index 2fc3d0e851..158674e7b9 100644 --- a/packages/strapi-plugin-users-permissions/services/Providers.js +++ b/packages/strapi-plugin-users-permissions/services/Providers.js @@ -47,10 +47,7 @@ exports.connect = (provider, query) => { try { const users = await strapi.query('user', 'users-permissions').find({ where: { - email: { - symbol: '=', - value: profile.email - } + email: profile.email } }); From 398ffa2f5f2a0b193e78265c328787126c280a54 Mon Sep 17 00:00:00 2001 From: Husam Ibrahim <39692071+HusamIbrahim@users.noreply.github.com> Date: Fri, 23 Nov 2018 17:29:17 +0300 Subject: [PATCH 3/3] [docs] Fix typos/grammar in quick-start.md --- docs/3.x.x/getting-started/quick-start.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/3.x.x/getting-started/quick-start.md b/docs/3.x.x/getting-started/quick-start.md index a37fb05454..e475365988 100644 --- a/docs/3.x.x/getting-started/quick-start.md +++ b/docs/3.x.x/getting-started/quick-start.md @@ -1,6 +1,6 @@ # Quick start -This section explains how to handle Strapi for the first time, ([check out our tutorial video](https://www.youtube.com/watch?v=yMl5IcFHA74)). +This section explains how to handle Strapi for the first time, ([check out our video tutorial](https://www.youtube.com/watch?v=yMl5IcFHA74)). **Table of contents:** - [1. Create your first project](#_1-create-a-project) @@ -170,7 +170,7 @@ axios If you want to get a specific entry, add the `id` of the wanted post at the end of the url. -Examble with Axios: +Example with Axios: ```js import axios from 'axios'; @@ -194,7 +194,7 @@ axios Use the `POST` route to create a new entry. -Examble with Axios: +Example with Axios: ```js import axios from 'axios'; @@ -221,7 +221,7 @@ axios Use the `PUT` route to update an existing entry. -Examble with Axios: +Example with Axios: ```js import axios from 'axios'; @@ -250,7 +250,7 @@ axios Use the `DELETE` route to delete an existing entry. -Examble with Axios: +Example with Axios: ```js import axios from 'axios';