mirror of
https://github.com/strapi/strapi.git
synced 2025-08-22 15:48:59 +00:00
Handle search user with bookshelf
This commit is contained in:
parent
b4a6336f14
commit
6596e42e0b
@ -238,5 +238,15 @@ module.exports = {
|
||||
// Resolve silently.
|
||||
return Promise.resolve();
|
||||
}
|
||||
},
|
||||
|
||||
search: async function (params) {
|
||||
return this
|
||||
.query(function(qb) {
|
||||
qb
|
||||
.where('username', 'LIKE', `%${params.id}%`)
|
||||
.orWhere('email', 'LIKE', `%${params.id}%`);
|
||||
})
|
||||
.fetchAll();
|
||||
}
|
||||
};
|
||||
|
@ -110,7 +110,6 @@ module.exports = {
|
||||
|
||||
searchUsers: async (ctx) => {
|
||||
const data = await strapi.query('user', 'users-permissions').search(ctx.params);
|
||||
|
||||
return ctx.send(data);
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user