diff --git a/backend/main.go b/backend/main.go index c6fd820..6211fa7 100644 --- a/backend/main.go +++ b/backend/main.go @@ -2,6 +2,7 @@ package main import ( "log" + "net/http" "github.com/gin-gonic/gin" "github.com/joho/godotenv" @@ -37,14 +38,14 @@ func main() { { api.POST("/login", handlers.Login) protected := api.Group("/") + api.GET("/items/:id", handlers.GetItem) + api.GET("/items/", handlers.GetAllItems) + api.GET("/getCategories", handlers.GetCategories) protected.Use(middleware.AuthRequired()) { - protected.GET("/items/:id", handlers.GetItem) - protected.GET("/items/", handlers.GetAllItems) protected.DELETE("/items/:id", handlers.DeleteItem) protected.PATCH("/items/:id", handlers.UpdateItem) protected.POST("/items", handlers.AddItem) - protected.GET("/getCategories", handlers.GetCategories) } admin := protected.Group("/") @@ -54,5 +55,9 @@ func main() { } } + r.NoRoute(func(c *gin.Context) { + c.JSON(http.StatusNotFound, gin.H{"status": 404, "message": "API not found"}) + }) + r.Run(":8081") } diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index da1240f..4356255 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -4,6 +4,7 @@ import AddItem from "./pages/AddItem"; import AuthForm from "./components/AuthForm"; import About from "./pages/About"; import Shop from "./pages/Shop"; +import NotFoundPage from "./pages/NotFoundPage"; const PrivateRoute = ({ children }) => { const token = localStorage.getItem("token"); @@ -19,38 +20,12 @@ export default function App() { } /> - -
- - } - /> - - - - } - /> - - - - } - /> - - - - } - /> + } /> + } /> + } /> + } /> + + } /> ); diff --git a/frontend/src/pages/About.jsx b/frontend/src/pages/About.jsx index 148d753..21b5595 100644 --- a/frontend/src/pages/About.jsx +++ b/frontend/src/pages/About.jsx @@ -1,24 +1,28 @@ import PageLayout from "../components/PageLayout"; -import { useState, useEffect } from "react" -import * as api from '../api/index' +import FishBack from "../assets/Исходники/fish1.jpg"; export default function Shop() { - - const [items, setItems] = useState([]) - const [loading, setLoading] = useState(true); - - useEffect(() => { - pa - }) - - - return ( -
-
-
-

fish fish

+
+
+
+ fish fish +
+
+
+ Мы FISH FISH занимаемся доставкой свежих морепродуктов и рыбы на + любой вкус. Всегда только свежие продукты в охлажденном состоянии, + герметичной упаковке. Наши курьеры привозят рыбу и морепродукты в + переносных холодильных пакетах или камерах. Качество продукции для + нас выше всего! +
+
+ +
diff --git a/frontend/src/pages/Main.jsx b/frontend/src/pages/Main.jsx index 8523046..0303767 100644 --- a/frontend/src/pages/Main.jsx +++ b/frontend/src/pages/Main.jsx @@ -17,7 +17,7 @@ export default function Dashboard() { className="px-5 md:px-16 grow w-full bg-cover bg-center bg-no-repeat h-screen overflow-hidden" style={{ backgroundImage: `url(${bgLayout})` }} > -
+
+
+

Страница не найдена :c

+
+ + ); +} diff --git a/frontend/src/pages/Shop.jsx b/frontend/src/pages/Shop.jsx index 69a061b..93f5cb8 100644 --- a/frontend/src/pages/Shop.jsx +++ b/frontend/src/pages/Shop.jsx @@ -41,7 +41,7 @@ export default function Shop() { return (
-

+

Ассортимент

-
+
{filteredItems.map((item) => ( ))}