From 96301f8a0bfe68368761536b61373212f2cec61c Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 12 Nov 2024 10:43:05 +0100 Subject: [PATCH] fix: hotfix create order from customer --- front/core/services/app.js | 16 ++++++++++++---- modules/client/front/descriptor/index.html | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/front/core/services/app.js b/front/core/services/app.js index dba6e70bf..816167835 100644 --- a/front/core/services/app.js +++ b/front/core/services/app.js @@ -70,10 +70,18 @@ export default class App { if (this.logger.$params.q) { let tableValue = this.logger.$params.q; - const q = JSON.parse(tableValue); - if (typeof q === 'number') - tableValue = JSON.stringify({id: tableValue}); - newRoute = newRoute.concat(`?table=${tableValue}`); + if (Array.isArray(tableValue)) { + const [key, param1, param2] = tableValue; + const payload = key === 'createForm' + ? {[param1]: param2} + : {[key]: param1}; + newRoute += `?${key}=${JSON.stringify(payload)}`; + } else { + const q = JSON.parse(tableValue); + if (typeof q === 'number') + tableValue = JSON.stringify({id: tableValue}); + newRoute = newRoute.concat(`?table=${tableValue}`); + } } else if (!hasId && this.logger.$params.id && newRoute.indexOf(this.logger.$params.id) < 0) newRoute = newRoute.concat(`${this.logger.$params.id}`); diff --git a/modules/client/front/descriptor/index.html b/modules/client/front/descriptor/index.html index f2dbd64b6..cecd7ee62 100644 --- a/modules/client/front/descriptor/index.html +++ b/modules/client/front/descriptor/index.html @@ -99,7 +99,7 @@