The searchQuery function in the searchAPI.ts file was constructin… (#22803)

* The `searchQuery` function in the `searchAPI.ts` file was constructing an incorrect query when the search value was empty. This caused the API call to fail and the assets were not displayed in the glossary term's assets tab.

This commit fixes the `searchQuery` function to correctly handle the case where the search value is empty.

* fix playwright test

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Ashish Gupta <ashish@getcollate.io>
This commit is contained in:
Sriharsha Chintalapani 2025-08-11 10:21:41 -07:00 committed by GitHub
parent 15b92735b9
commit d41fbc3968
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 6 deletions

View File

@ -386,7 +386,7 @@ export const addAssetsToDomain = async (
return (
response
.url()
.includes('/api/v1/search/query?q=**&index=all&from=0&size=15') &&
.includes('/api/v1/search/query?q=&index=all&from=0&size=15') &&
queryFilter !== null &&
queryFilter !== ''
);

View File

@ -176,11 +176,12 @@ export const rawSearchQuery = <
const queryWithSlash = getQueryWithSlash(query || '');
const apiQuery = query
? filters
? `${queryWithSlash} AND `
: queryWithSlash
: '';
const apiQuery =
query && query !== '**'
? filters
? `${queryWithSlash} AND `
: queryWithSlash
: '';
const apiUrl = `/search/query?q=${apiQuery}${filters ?? ''}`;