From 6688ccf1ab29ef958075d17ccc7df1b46d467a20 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 15 Oct 2024 15:50:52 +0200 Subject: [PATCH] Ensure we replace only on when starting with --- packages/server/src/sdk/app/rows/search/filters.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/server/src/sdk/app/rows/search/filters.ts b/packages/server/src/sdk/app/rows/search/filters.ts index 4049fc5352..64656b1a37 100644 --- a/packages/server/src/sdk/app/rows/search/filters.ts +++ b/packages/server/src/sdk/app/rows/search/filters.ts @@ -53,8 +53,12 @@ export function updateFilterKeys( ) if (possibleKey && possibleKey.original !== possibleKey.updated) { // only replace the first, not replaceAll - filter[key.replace(possibleKey.original, possibleKey.updated)] = - filter[key] + filter[ + key.replace( + new RegExp(`^${possibleKey.original}\\.`), + `${possibleKey.updated}.` + ) + ] = filter[key] delete filter[key] } }