From 8da044f903edafa95f75669d675cf8fb3779566a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Thu, 29 Jul 2021 16:24:19 +0100 Subject: [PATCH] fix: string replace optimization --- lib/customers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/customers.js b/lib/customers.js index f6f5d499..d1c4ee5f 100644 --- a/lib/customers.js +++ b/lib/customers.js @@ -272,7 +272,7 @@ function updateOverride (fields) { const updatedFields = _.intersection(updateableFields, _.keys(fields)) const overrideFields = _.fromPairs(_.map(f => _.endsWith('_path', f) - ? [`${_.replace('_path', '', f)}_override`, 'automatic'] + ? [`${_.replace('_path', '_override', f)}`, 'automatic'] : [`${f}_override`, 'automatic'] , updatedFields))