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": "^9",
|
||||||
"eslint-config-next": "15.5.5",
|
"eslint-config-next": "15.5.5",
|
||||||
"tailwindcss": "^4",
|
"tailwindcss": "^4",
|
||||||
|
"turbo": "^2.6.3",
|
||||||
"typescript": "^5"
|
"typescript": "^5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ const useAuthentificate = () => {
|
||||||
return useMutation({
|
return useMutation({
|
||||||
mutationKey: ["auth"],
|
mutationKey: ["auth"],
|
||||||
mutationFn: async (authData: AuthDataType) => {
|
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;
|
const { access_token } = await response.data;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,9 @@ import { Inter } from "next/font/google";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
import Header from "@/components/layout/Header";
|
import Header from "@/components/layout/Header";
|
||||||
import Footer from "@/components/layout/Footer";
|
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 = {
|
export const metadata: Metadata = {
|
||||||
title: "Travel Marine - Аренда яхт в Балаклаве",
|
title: "Travel Marine - Аренда яхт в Балаклаве",
|
||||||
|
|
@ -19,9 +20,11 @@ export default function RootLayout({
|
||||||
return (
|
return (
|
||||||
<html lang="ru">
|
<html lang="ru">
|
||||||
<body className={`${inter.className} flex flex-col min-h-screen`}>
|
<body className={`${inter.className} flex flex-col min-h-screen`}>
|
||||||
|
<Providers>
|
||||||
<Header />
|
<Header />
|
||||||
{children}
|
{children}
|
||||||
<Footer />
|
<Footer />
|
||||||
|
</Providers>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</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