Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Update search.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinsina authored Apr 20, 2023
1 parent 5b0aecd commit 9c0c3e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/marko-web-search/loaders/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ module.exports = async ({ apolloBaseCMS, apolloBaseBrowse } = {}, {

queryFragment,
opSuffix,
enableNewSearch = false,
useAutocomplete = false,
} = {}) => {
if (!apolloBaseCMS || !apolloBaseBrowse) throw new Error('Both the BaseCMS and Base Browse Apollo clients must be provided.');
const input = {
omitScheduledAndExpiredContent: true,
statuses: ['PUBLISHED'],
contentTypes,
countryCodes,
...(!enableNewSearch && searchQuery && { search: { query: searchQuery } }),
...(enableNewSearch && searchQuery && { autocomplete: { phrase: searchQuery } }),
...(!useAutocomplete && searchQuery && { search: { query: searchQuery } }),
...(useAutocomplete && searchQuery && { autocomplete: { phrase: searchQuery } }),
...((assignedToWebsiteSiteIds.length || assignedToWebsiteSectionIds.length) && {
assignedToWebsites: {
...(assignedToWebsiteSiteIds.length && { siteIds: assignedToWebsiteSiteIds }),
Expand Down

0 comments on commit 9c0c3e8

Please sign in to comment.