File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/frontend/apps/impress/src/features/docs/doc-management/api Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,16 @@ export const constructParams = (params: DocsParams): URLSearchParams => {
4444export type DocsResponse = APIList < Doc > ;
4545export const getDocs = async ( params : DocsParams ) : Promise < DocsResponse > => {
4646 const searchParams = constructParams ( params ) ;
47- const response = await fetchAPI ( `documents/?${ searchParams . toString ( ) } ` ) ;
47+ let response
48+
49+ // HACK for fulltext search feature
50+ if ( searchParams . has ( 'title' ) ) {
51+ searchParams . set ( 'q' , searchParams . get ( 'title' ) || '' ) ;
52+ searchParams . delete ( 'title' ) ;
53+ response = await fetchAPI ( `documents/search?${ searchParams . toString ( ) } ` ) ;
54+ } else {
55+ response = await fetchAPI ( `documents/?${ searchParams . toString ( ) } ` ) ;
56+ }
4857
4958 if ( ! response . ok ) {
5059 throw new APIError ( 'Failed to get the docs' , await errorCauses ( response ) ) ;
You can’t perform that action at this time.
0 commit comments