mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
better matching
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
20
nextjs/src/services/utils/queryClientServer.tsx
Normal file
20
nextjs/src/services/utils/queryClientServer.tsx
Normal 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),
|
||||
}),
|
||||
});
|
||||
Reference in New Issue
Block a user