refs #6694 perf: remove unused imports
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Javier Segarra 2024-01-24 08:38:34 +01:00
parent 5b2b6a15ad
commit 40d5e8662b
1 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,5 @@
const {ParameterizedSQL} = require('loopback-connector'); const {ParameterizedSQL} = require('loopback-connector');
const {buildFilter, mergeFilters} = require('vn-loopback/util/filter'); const {buildFilter} = require('vn-loopback/util/filter');
// const {models} = require('vn-loopback/server/server');
module.exports = Self => { module.exports = Self => {
Self.remoteMethod('filter', { Self.remoteMethod('filter', {
@ -41,12 +40,13 @@ module.exports = Self => {
const where = buildFilter(filter?.where, (param, value) => { const where = buildFilter(filter?.where, (param, value) => {
switch (param) { switch (param) {
case 'search': case 'search':
return {or: [ return {
{'pc.code': {like: `%${value}%`}}, or: [
{'t.name': {like: `%${value}%`}}, {'pc.code': {like: `%${value}%`}},
{'p.name': {like: `%${value}%`}}, {'t.name': {like: `%${value}%`}},
{'c.country': {like: `%${value}%`}} {'p.name': {like: `%${value}%`}},
] {'c.country': {like: `%${value}%`}}
]
}; };
} }
}) ?? {}; }) ?? {};