Feat: Enable the wiki's Markdown editor to navigate to a new Markdown file when a link is clicked. (#17019)

This commit is contained in:
balibabu
2026-07-17 11:22:18 +08:00
committed by GitHub
parent f69ed74670
commit 677960716e
12 changed files with 688 additions and 194 deletions

View File

@@ -591,15 +591,17 @@ export const useFetchArtifactTopicList = (
};
};
export function useFetchArtifactPage(artifact: IArtifact | null) {
export function useFetchArtifactPage(
artifact: IArtifact | null,
enabled = true,
) {
const knowledgeBaseId = useKnowledgeBaseId();
const pageType = artifact?.page_type ?? '';
const slug = artifact?.slug ?? '';
const { data, isFetching: loading } = useQuery<IArtifactPage | null>({
queryKey: ArtifactKeys.detail(knowledgeBaseId, pageType, slug),
enabled: !!knowledgeBaseId && !!artifact && !!pageType && !!slug,
gcTime: 0,
enabled: !!knowledgeBaseId && !!artifact && !!pageType && !!slug && enabled,
queryFn: async () => {
const { data } = await getArtifactPage(knowledgeBaseId, pageType, slug);
return data?.data ?? null;