Add queryClient

This commit is contained in:
Иван 2025-12-14 14:30:54 +03:00
parent c592ba9eaf
commit 85c23f136e
5 changed files with 901 additions and 746 deletions

1602
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -44,6 +44,7 @@
"eslint": "^9",
"eslint-config-next": "15.5.5",
"tailwindcss": "^4",
"turbo": "^2.6.3",
"typescript": "^5"
}
}

View File

@ -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;

View File

@ -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>
);

11
src/app/providers.tsx Normal file
View File

@ -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>
);
}