Add queryClient
This commit is contained in:
parent
c592ba9eaf
commit
85c23f136e
File diff suppressed because it is too large
Load Diff
|
|
@ -44,6 +44,7 @@
|
|||
"eslint": "^9",
|
||||
"eslint-config-next": "15.5.5",
|
||||
"tailwindcss": "^4",
|
||||
"turbo": "^2.6.3",
|
||||
"typescript": "^5"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ const useAuthentificate = () => {
|
|||
return useMutation({
|
||||
mutationKey: ["auth"],
|
||||
mutationFn: async (authData: AuthDataType) => {
|
||||
const response = await client.post("/api/auth/login/", authData);
|
||||
const response = await client.post("/auth/login/", authData);
|
||||
|
||||
const { access_token } = await response.data;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@ import { Inter } from "next/font/google";
|
|||
import "./globals.css";
|
||||
import Header from "@/components/layout/Header";
|
||||
import Footer from "@/components/layout/Footer";
|
||||
import Providers from "./providers";
|
||||
|
||||
const inter = Inter({ subsets: ["latin", "cyrillic"] }); // Поддержка русского
|
||||
const inter = Inter({ subsets: ["latin", "cyrillic"] });
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Travel Marine - Аренда яхт в Балаклаве",
|
||||
|
|
@ -19,9 +20,11 @@ export default function RootLayout({
|
|||
return (
|
||||
<html lang="ru">
|
||||
<body className={`${inter.className} flex flex-col min-h-screen`}>
|
||||
<Providers>
|
||||
<Header />
|
||||
{children}
|
||||
<Footer />
|
||||
</Providers>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
"use client";
|
||||
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
|
||||
export default function Providers({ children }: { children: React.ReactNode }) {
|
||||
const queryClient = new QueryClient();
|
||||
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in New Issue