Skip to content

Commit

Permalink
fix query enable
Browse files Browse the repository at this point in the history
  • Loading branch information
Heather0K committed Mar 5, 2024
1 parent a7327d8 commit 5f32e28
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion services/madoc-ts/src/frontend/site/hooks/use-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function normalizeDotKey(key: string) {
}

export function useSearch() {
const { projectId, collectionId, manifestId, topic } = useRouteContext();
const { projectId, collectionId, manifestId, topic, topicType } = useRouteContext();
const { fulltext, appliedFacets, page, rscType } = useSearchQuery();
const {
project: { searchStrategy, claimGranularity, searchOptions },
Expand Down Expand Up @@ -46,6 +46,7 @@ export function useSearch() {
? {
type: 'entity',
group_id: facet.v,
subtype: topicType,
}
: {
type: facet.t,
Expand Down Expand Up @@ -84,7 +85,10 @@ export function useSearch() {
!!rscType ||
collectionId ||
manifestId ||
topic ||
topicType ||
projectId),
staleTime: 0,
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ export function useTopicSearch() {
{
enabled:
!searchFacetConfig.isLoading &&
(!!facetsToRequest.length || !!fulltext || fulltext === '' || !!topicFacets || !!rscType || !!topic),
(!!facetsToRequest.length ||
!!fulltext ||
fulltext === '' ||
!!topicFacets ||
!!rscType ||
!!topic ||
topicType),
staleTime: 0,
}
);
Expand Down

0 comments on commit 5f32e28

Please sign in to comment.