add: display home markdown

This commit is contained in:
h z
2024-12-09 21:15:04 +00:00
parent 90897165db
commit d88fb34881
4 changed files with 212538 additions and 2 deletions

View File

@@ -29,6 +29,21 @@ export const useIndexMarkdown = (path_id) => {
});
};
export const useHomeMarkdown = () => {
const queryClient = useQueryClient();
const config = useConfig();
return useQuery(
["home_markdown"],
() => fetch_(`${config.BACKEND_HOST}/api/markdown/get_home`), {
onSuccess: (data) => {
if (data && data.id){
queryClient.setQueryData(["markdown", data.id], data);
}
}
});
};
export const useMarkdownsByPath = (pathId) => {
const config = useConfig();
return useQuery(