Skip to content

Commit

Permalink
(PC-33718) refactor(useSortedSearchCategories): simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
nmajorfrances-pass committed Jan 10, 2025
1 parent 27d5a83 commit 1c263cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('useSortedSearchCategories', () => {
expect(result.current[0]?.navigateTo.params).toEqual({
params: {
params: {
isFullyDigitalOffersCategory: undefined,
isFullyDigitalOffersCategory: false,
offerCategories: ['CONCERTS_FESTIVALS'],
searchId: 'testUuidV4',
},
Expand Down Expand Up @@ -91,7 +91,7 @@ describe('useSortedSearchCategories', () => {
expect(result.current[3]?.navigateTo.params).toEqual({
params: {
params: {
isFullyDigitalOffersCategory: undefined,
isFullyDigitalOffersCategory: false,
offerCategories: ['LIVRES'],
searchId: 'testUuidV4',
},
Expand All @@ -108,7 +108,7 @@ describe('useSortedSearchCategories', () => {
expect(result.current[3]?.navigateTo.params).toEqual({
params: {
params: {
isFullyDigitalOffersCategory: undefined,
isFullyDigitalOffersCategory: false,
offerCategories: ['LIVRES'],
searchId: 'testUuidV4',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const useSortedSearchCategories = (): ListCategoryButtonProps => {
hasAThematicSearch.includes(facetFilter) ? 'ThematicSearch' : 'SearchResults',
{
offerCategories: [facetFilter],
isFullyDigitalOffersCategory: (data && isOnlyOnline(data, facetFilter)) || undefined,
isFullyDigitalOffersCategory: data && isOnlyOnline(data, facetFilter),
searchId: uuidv4(),
}
)
Expand Down

0 comments on commit 1c263cd

Please sign in to comment.