mirror of
https://github.com/soconnor0919/beenvoice.git
synced 2025-12-17 21:03:16 -05:00
Add Turso/Vercel deployment configuration
- Updated database connection to support Turso auth token - Added vercel.json with bun build configuration - Updated environment schema for production deployment - Added new features and components for production readiness
This commit is contained in:
@@ -1,11 +1,47 @@
|
||||
import {
|
||||
defaultShouldDehydrateQuery,
|
||||
QueryClient,
|
||||
QueryCache,
|
||||
MutationCache,
|
||||
} from "@tanstack/react-query";
|
||||
import { TRPCClientError } from "@trpc/client";
|
||||
import { toast } from "sonner";
|
||||
import SuperJSON from "superjson";
|
||||
|
||||
export const createQueryClient = () =>
|
||||
new QueryClient({
|
||||
queryCache: new QueryCache({
|
||||
onError: (error) => {
|
||||
if (
|
||||
error instanceof TRPCClientError &&
|
||||
error.data &&
|
||||
typeof error.data === "object" &&
|
||||
"code" in error.data &&
|
||||
(error.data as { code: string }).code === "UNAUTHORIZED"
|
||||
) {
|
||||
toast.error("Please sign in to continue");
|
||||
if (typeof window !== "undefined") {
|
||||
window.location.href = "/auth/signin";
|
||||
}
|
||||
}
|
||||
},
|
||||
}),
|
||||
mutationCache: new MutationCache({
|
||||
onError: (error) => {
|
||||
if (
|
||||
error instanceof TRPCClientError &&
|
||||
error.data &&
|
||||
typeof error.data === "object" &&
|
||||
"code" in error.data &&
|
||||
(error.data as { code: string }).code === "UNAUTHORIZED"
|
||||
) {
|
||||
toast.error("Please sign in to continue");
|
||||
if (typeof window !== "undefined") {
|
||||
window.location.href = "/auth/signin";
|
||||
}
|
||||
}
|
||||
},
|
||||
}),
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
// With SSR, we usually want to set some default staleTime
|
||||
|
||||
Reference in New Issue
Block a user