Skip to content

Commit

Permalink
use merge from lodash to join a custom populate
Browse files Browse the repository at this point in the history
Signed-off-by: Juan David <juand.business@gmail.com>
  • Loading branch information
juandl committed Jun 22, 2020
1 parent 7d24c2e commit c5ea3cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/strapi-plugin-users-permissions/services/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ module.exports = {
* @return {Promise}
*/
fetch(params, populate) {
const defaultPopulate = [...populate, 'role'];
let defaultPopulate = ['role'];

if (populate) _.merge(defaultPopulate, populate);

return strapi.query('user', 'users-permissions').findOne(params, defaultPopulate);
},
Expand Down

0 comments on commit c5ea3cf

Please sign in to comment.