From faf307bc16b3ff2d9b31403b25178fcc8215bb7e Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 14 Nov 2024 12:59:18 +0100 Subject: [PATCH] fix: #8192 find by thermographFk instead id --- .../Travel/Card/TravelThermographsForm.vue | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/pages/Travel/Card/TravelThermographsForm.vue b/src/pages/Travel/Card/TravelThermographsForm.vue index f56ef1eda..3f2db8954 100644 --- a/src/pages/Travel/Card/TravelThermographsForm.vue +++ b/src/pages/Travel/Card/TravelThermographsForm.vue @@ -133,6 +133,25 @@ const onThermographCreated = async (data) => { warehouseId: data.warehouseFk, }; }; + +const exprBuilder = (param, value) => { + switch (param) { + case 'search': + return /^\d+$/.test(value) + ? { id: value } + : { + or: [ + { name: { like: `%${value}%` } }, + { nickname: { like: `%${value}%` } }, + ], + }; + case 'name': + case 'nickname': + return { [param]: { like: `%${value}%` } }; + case 'roleFk': + return { [param]: value }; + } +};