diff --git a/src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-inline-content/Interlinking/SearchPage.tsx b/src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-inline-content/Interlinking/SearchPage.tsx index f685735f3..42f8b8d77 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-inline-content/Interlinking/SearchPage.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-inline-content/Interlinking/SearchPage.tsx @@ -263,7 +263,7 @@ export const SearchPage = ({ { if (!isEditable) { diff --git a/src/frontend/apps/impress/src/features/docs/doc-search/api/useSearchDocs.tsx b/src/frontend/apps/impress/src/features/docs/doc-search/api/useSearchDocs.tsx index 54339e493..0074cdca7 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-search/api/useSearchDocs.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-search/api/useSearchDocs.tsx @@ -15,21 +15,21 @@ export type SearchDocsParams = { page: number; q: string; filter?: DocSearchFilterTypes; - parentPath?: string; + parentDocId?: string; }; const constructParams = ({ q, page, filter, - parentPath, + parentDocId, }: SearchDocsParams): URLSearchParams => { const searchParams = new URLSearchParams(); searchParams.set('q', q); - if (filter === 'current' && parentPath) { - searchParams.set('path', parentPath); + if (filter === 'current' && parentDocId) { + searchParams.set('document', parentDocId); } if (page) { searchParams.set('page', page.toString()); @@ -48,9 +48,9 @@ const searchDocs = async ({ q, page, filter, - parentPath, + parentDocId, }: SearchDocsParams): Promise => { - const searchParams = constructParams({ q, page, filter, parentPath }); + const searchParams = constructParams({ q, page, filter, parentDocId }); const response = await fetchAPI( `documents/search/?${searchParams.toString()}`, ); diff --git a/src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchContent.tsx b/src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchContent.tsx index 2044d401e..909d43628 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchContent.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchContent.tsx @@ -19,7 +19,7 @@ type DocSearchContentProps = { onResults?: (results: DocSearch[]) => void; onSelect: (doc: DocSearch) => void; onLoadingChange?: (loading: boolean) => void; - parentPath?: string; + parentDocId?: string; renderSearchElement?: (doc: DocSearch) => React.ReactNode; }; @@ -31,7 +31,7 @@ export const DocSearchContent = ({ onSelect, onLoadingChange, renderSearchElement, - parentPath, + parentDocId, isSearchNotMandatory, }: DocSearchContentProps) => { const { filter } = useDocSearchFilterStore(); @@ -47,10 +47,10 @@ export const DocSearchContent = ({ q: search, page: 1, filter, - parentPath, + parentDocId, }, { - enabled: filter !== 'current' || !!parentPath, + enabled: filter !== 'current' || !!parentDocId, }, ); diff --git a/src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchModal.tsx b/src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchModal.tsx index d08f55dad..572d88aac 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchModal.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchModal.tsx @@ -41,13 +41,13 @@ type DocSearchModalGlobalProps = { isOpen: boolean; showFilters?: boolean; defaultFilters: DocSearchFilterTypes; - parentPath?: string; // If defined, the search will be limited to the children of the document with the given path + parentDocId?: string; // If defined, the search will be limited to the children of the document with the given id }; const DocSearchModalGlobal = ({ showFilters = false, defaultFilters, - parentPath, + parentDocId, ...modalProps }: DocSearchModalGlobalProps) => { const { t } = useTranslation(); @@ -175,7 +175,7 @@ const DocSearchModalGlobal = ({ onSelect={handleSelect} onResults={setResults} onLoadingChange={setLoading} - parentPath={filter === 'current' ? parentPath : undefined} + parentDocId={filter === 'current' ? parentDocId : undefined} /> )} @@ -203,7 +203,7 @@ const DocSearchModalDetail = ({ {...modalProps} showFilters={isWithChildren && authenticated} defaultFilters={isWithChildren ? 'current' : 'all'} - parentPath={treeContext?.root?.path} + parentDocId={treeContext?.root?.id} /> ); };