mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-06 20:51:48 +02:00
♻️ Switch to app router (#922)
This commit is contained in:
parent
41f85279bb
commit
95feb9f01a
181 changed files with 2507 additions and 2494 deletions
31
apps/web/src/utils/trpc/config.ts
Normal file
31
apps/web/src/utils/trpc/config.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import * as Sentry from "@sentry/browser";
|
||||
import { MutationCache } from "@tanstack/react-query";
|
||||
import { httpBatchLink } from "@trpc/client";
|
||||
import toast from "react-hot-toast";
|
||||
import superjson from "superjson";
|
||||
|
||||
export const trpcConfig = {
|
||||
links: [
|
||||
httpBatchLink({
|
||||
url: "/api/trpc",
|
||||
}),
|
||||
],
|
||||
transformer: superjson,
|
||||
queryClientConfig: {
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
retry: false,
|
||||
cacheTime: Infinity,
|
||||
staleTime: 1000 * 60,
|
||||
},
|
||||
},
|
||||
mutationCache: new MutationCache({
|
||||
onError: (error) => {
|
||||
toast.error(
|
||||
"Uh oh! Something went wrong. The issue has been logged and we'll fix it as soon as possible. Please try again later.",
|
||||
);
|
||||
Sentry.captureException(error);
|
||||
},
|
||||
}),
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue