better matching

This commit is contained in:
2024-08-26 12:52:55 -06:00
parent 884e465df6
commit cafe04faf6
15 changed files with 232 additions and 33 deletions

View File

@@ -5,6 +5,7 @@ import { courseMarkdownLoader } from "./utils/couresMarkdownLoader";
import { courseMarkdownSaver } from "./utils/courseMarkdownSaver";
const basePath = process.env.STORAGE_DIRECTORY ?? "./storage";
console.log("base path", basePath);
export const fileStorageService = {
async saveCourseAsync(

View File

@@ -3,6 +3,7 @@
import {
DehydratedState,
hydrate,
HydrationBoundary,
QueryClientProvider,
} from "@tanstack/react-query";
import React from "react";
@@ -15,9 +16,9 @@ export const MyQueryClientProvider: FC<{
}> = ({ children, dehydratedState }) => {
const [queryClient] = useState(createQueryClient());
hydrate(queryClient, dehydratedState);
return (
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
<QueryClientProvider client={queryClient}>
<HydrationBoundary state={dehydratedState}>{children}</HydrationBoundary>
</QueryClientProvider>
);
};

View File

@@ -0,0 +1,20 @@
import { MutationCache, QueryCache, QueryClient } from "@tanstack/react-query";
export const createQueryClientForServer = () => new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
retry: 0,
},
mutations: {
onError: (e) => console.log(e),
retry: 0,
},
},
queryCache: new QueryCache({
onError: (e) => console.log(e),
}),
mutationCache: new MutationCache({
onError: (e) => console.log(e),
}),
});