From c4ed6ee2e136cdd05bcb6e2f3ac2fe3bf944e3e3 Mon Sep 17 00:00:00 2001 From: rjohanek Date: Mon, 25 Nov 2024 14:34:11 -0500 Subject: [PATCH] reduce URLs and rename parameter --- .../DataSearch/dataset_search_table.spec.js | 4 ++-- src/components/data_search/DatasetFilterList.jsx | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cypress/component/DataSearch/dataset_search_table.spec.js b/cypress/component/DataSearch/dataset_search_table.spec.js index 0af56e69c..560901e05 100644 --- a/cypress/component/DataSearch/dataset_search_table.spec.js +++ b/cypress/component/DataSearch/dataset_search_table.spec.js @@ -63,7 +63,7 @@ describe('Dataset Search Table tests', () => { it('When a participant count filter is applied the query is updated', () => { cy.intercept( - {method: 'POST', url: '**/api/dataset/search/index'}, (req) => { + {method: 'POST', url: '**/search/index'}, (req) => { return handler(req, '{"range":{"participantCount":{"gte":null,"lte":50}}}'); }).as('searchIndex'); mount(); @@ -79,7 +79,7 @@ describe('Dataset Search Table tests', () => { it('When an invalid participant count filter is applied the query represents the default value', () => { - cy.intercept({method: 'POST', url: '**/api/dataset/search/index'}, (req) => { + cy.intercept({method: 'POST', url: '**/search/index'}, (req) => { // when non-numeric input is entered, the default value (in this case, 100) is used return handler(req, '{"range":{"participantCount":{"gte":100,"lte":null}}}'); }).as('searchIndex'); diff --git a/src/components/data_search/DatasetFilterList.jsx b/src/components/data_search/DatasetFilterList.jsx index 97778c0f3..c8ff3d562 100644 --- a/src/components/data_search/DatasetFilterList.jsx +++ b/src/components/data_search/DatasetFilterList.jsx @@ -25,16 +25,16 @@ export const FilterItemList = (props) => { return ( { - filter.map((filter) => { - const filterName = filterNameFn(filter); + filter.map((filterOption) => { + const filterName = filterNameFn(filterOption); return ( - - filterHandler(category, filter)}> + + filterHandler(category, filterOption)}> - + - {filterDisplayFn ? filterDisplayFn(filter) : filterName} + {filterDisplayFn ? filterDisplayFn(filterOption) : filterName}