Skip to content

Commit

Permalink
change: advanced search to trigger 'only artworks' button for the sea…
Browse files Browse the repository at this point in the history
…rch results
  • Loading branch information
cihanandac committed Jun 24, 2024
1 parent 0146096 commit 8777b41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const AdvancedSearch = () => {
history.push(
`/search?SearchableText=${encodeURIComponent(
searchQuery,
)}&portal_type=artwork`,
)}&advancedsearch=true`,
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ class Search extends Component {
currentUrlParams.delete('portal_type:list');
currentUrlParams.delete('hasPreviewImage');
currentUrlParams.delete('ObjOnDisplay');
currentUrlParams.delete('advancedsearch');

if (this.state.onlyArtworks) {
currentUrlParams.set('portal_type', 'artwork');
Expand Down Expand Up @@ -258,6 +259,12 @@ class Search extends Component {

doSearch = () => {
const options = qs.parse(this.props.history.location.search);
if (
options?.advancedsearch === 'true' &&
options.portal_type !== 'artwork'
) {
this.handleCheckboxChange('onlyArtworks');
}

if (this.state.onlyArtworks) {
options.portal_type = 'artwork';
Expand Down

0 comments on commit 8777b41

Please sign in to comment.