This commit is contained in:
hamid zarghami
2026-06-21 14:52:20 +03:30
parent ba82744219
commit de45b1f197
19 changed files with 622 additions and 157 deletions
@@ -1,16 +1,23 @@
import { useQuery } from "@tanstack/react-query";
import * as api from "../service/AboutService";
import { useParams } from "next/navigation";
import * as api from "../service/AboutService";
import { setPersistedAboutData } from "@/lib/helpers/themeCache";
export const useGetAbout = () => {
const { name } = useParams<{ name: string }>();
return useQuery({
queryKey: ["about", name],
queryFn: () => api.getAbout(name),
queryFn: async () => {
const data = await api.getAbout(name);
setPersistedAboutData(name, data);
return data;
},
enabled: !!name,
retry: false,
staleTime: 5 * 60_000,
staleTime: 60 * 60_000,
gcTime: 24 * 60 * 60_000,
refetchOnMount: false,
refetchOnWindowFocus: false,
});
};