From daa530c48ccff2b59dd864df6bb4fb705f43da72 Mon Sep 17 00:00:00 2001 From: Jose Amietta Date: Wed, 3 Jan 2024 17:15:43 -0300 Subject: [PATCH] fix category_id by category_uid on SearchBar useSuggestedCategory --- .../__tests__/__snapshots__/useSuggestedCategory.spec.js.snap | 2 +- .../lib/talons/SearchBar/__tests__/useSuggestedCategory.spec.js | 2 +- packages/peregrine/lib/talons/SearchBar/useSuggestedCategory.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/peregrine/lib/talons/SearchBar/__tests__/__snapshots__/useSuggestedCategory.spec.js.snap b/packages/peregrine/lib/talons/SearchBar/__tests__/__snapshots__/useSuggestedCategory.spec.js.snap index 86063c2dd5..d955c4e9bb 100644 --- a/packages/peregrine/lib/talons/SearchBar/__tests__/__snapshots__/useSuggestedCategory.spec.js.snap +++ b/packages/peregrine/lib/talons/SearchBar/__tests__/__snapshots__/useSuggestedCategory.spec.js.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`#useSuggestedCategory returns valid destination 1`] = `"/search.html?query=bar&category_id%5Bfilter%5D=foo%2C1"`; +exports[`#useSuggestedCategory returns valid destination 1`] = `"/search.html?query=bar&category_uid%5Bfilter%5D=foo%2CMQ%3D%3D"`; diff --git a/packages/peregrine/lib/talons/SearchBar/__tests__/useSuggestedCategory.spec.js b/packages/peregrine/lib/talons/SearchBar/__tests__/useSuggestedCategory.spec.js index fb8ec2f685..6e41e97fd4 100644 --- a/packages/peregrine/lib/talons/SearchBar/__tests__/useSuggestedCategory.spec.js +++ b/packages/peregrine/lib/talons/SearchBar/__tests__/useSuggestedCategory.spec.js @@ -14,7 +14,7 @@ jest.mock('react-router-dom', () => ({ })); const props = { - categoryId: 1, + categoryId: 'MQ==', label: 'foo', searchValue: 'bar' }; diff --git a/packages/peregrine/lib/talons/SearchBar/useSuggestedCategory.js b/packages/peregrine/lib/talons/SearchBar/useSuggestedCategory.js index a3649641ef..e1d6562642 100644 --- a/packages/peregrine/lib/talons/SearchBar/useSuggestedCategory.js +++ b/packages/peregrine/lib/talons/SearchBar/useSuggestedCategory.js @@ -9,7 +9,7 @@ const setSearchParams = (existing, options) => { const { categoryId, label, searchValue } = options; params.set('query', searchValue); - params.set('category_id[filter]', `${label}${DELIMITER}${categoryId}`); + params.set('category_uid[filter]', `${label}${DELIMITER}${categoryId}`); return `${params}`; };