From c0f3caacda6acdd1dbf6074561b9f6c1da4f5512 Mon Sep 17 00:00:00 2001 From: Daniel Covington Date: Mon, 18 May 2026 15:26:57 -0400 Subject: [PATCH] coerce api_lookup customer attrs to text when imported into job type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a customer_lookup attribute imports fields from a customer type, any api_lookup fields are flattened to plain text — the value comes from the selected customer record, so the lookup UI is not needed --- public/js/app.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/public/js/app.js b/public/js/app.js index dbdbef7..375ae92 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1202,14 +1202,15 @@ window.jobTypeForm = function (initialAttributes, customerTypes) { var imported = ct.attributes.slice().sort(function (a, b) { return (a.order || 0) - (b.order || 0); }).map(function (a) { + var importedType = (a.type === 'api_lookup') ? 'text' : (a.type || 'text'); return { name: a.name || '', - type: a.type || 'text', + type: importedType, alias: a.alias || '', order: 0, - api_url: a.api_url || '', - api_match_field: a.api_match_field || '', - api_auto_fill: a.api_auto_fill || '', + api_url: '', + api_match_field: '', + api_auto_fill: '', api_format: a.api_format || 'json', api_return_type: a.api_return_type || 'text', customer_type_id: 0,