From 0d6e424a3e8bce45439e2b590e5d615d81bef649 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Mon, 28 Nov 2022 10:21:01 +0100 Subject: [PATCH 1/2] allow client search by socialname --- modules/client/back/methods/client/filter.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/client/back/methods/client/filter.js b/modules/client/back/methods/client/filter.js index 3e1ea43bb..6a545b594 100644 --- a/modules/client/back/methods/client/filter.js +++ b/modules/client/back/methods/client/filter.js @@ -91,7 +91,10 @@ module.exports = Self => { case 'search': return /^\d+$/.test(value) ? {'c.id': {inq: value}} - : {'c.name': {like: `%${value}%`}}; + : {or: [ + {'c.name': {like: `%${value}%`}}, + {'c.socialName': {like: `%${value}%`}}, + ]}; case 'name': case 'salesPersonFk': case 'fi':