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