Skip to content

Commit

Permalink
reduce URLs and rename parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
raejohanek committed Nov 25, 2024
1 parent 24ca3b1 commit c4ed6ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cypress/component/DataSearch/dataset_search_table.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(<DatasetSearchTable {...props} />);
Expand All @@ -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');
Expand Down
12 changes: 6 additions & 6 deletions src/components/data_search/DatasetFilterList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ export const FilterItemList = (props) => {
return (
<List sx={{ margin: '-0.5em -0.5em' }}>
{
filter.map((filter) => {
const filterName = filterNameFn(filter);
filter.map((filterOption) => {
const filterName = filterNameFn(filterOption);
return (
<ListItem disablePadding key={filter}>
<ListItemButton sx={{ padding: '0' }} onClick={() => filterHandler(category, filter)}>
<ListItem disablePadding key={filterOption}>
<ListItemButton sx={{ padding: '0' }} onClick={() => filterHandler(category, filterOption)}>
<ListItemIcon>
<Checkbox checked={isFiltered(filter, category)} />
<Checkbox checked={isFiltered(filterOption, category)} />
</ListItemIcon>
<ListItemText sx={{ fontFamily: 'Montserrat', transform: 'scale(1.2)' }}>
{filterDisplayFn ? filterDisplayFn(filter) : filterName}
{filterDisplayFn ? filterDisplayFn(filterOption) : filterName}
</ListItemText>
</ListItemButton>
</ListItem>
Expand Down

0 comments on commit c4ed6ee

Please sign in to comment.