From e7e4aaf664fdc139b5e7f93bee3b80b185276c36 Mon Sep 17 00:00:00 2001 From: jsapro <77.3.77@mail.ru> Date: Wed, 10 Jan 2024 14:56:26 +0300 Subject: [PATCH] feat: add 404 route --- src/App.tsx | 1 + src/pages/category/index.tsx | 2 +- src/pages/product/index.tsx | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 63ed8053..abaf1a7a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -59,6 +59,7 @@ function App() { } /> } /> + } /> } /> diff --git a/src/pages/category/index.tsx b/src/pages/category/index.tsx index d9bc78f2..695bc75b 100644 --- a/src/pages/category/index.tsx +++ b/src/pages/category/index.tsx @@ -44,7 +44,7 @@ const Category: React.FC = () => { setCategoryObj(data.results[0]?.category); }) .catch(() => { - navigate('/упс'); + navigate('/404'); }) .finally(() => { setIsLoading(false); diff --git a/src/pages/product/index.tsx b/src/pages/product/index.tsx index 0c34519e..614021be 100644 --- a/src/pages/product/index.tsx +++ b/src/pages/product/index.tsx @@ -41,11 +41,11 @@ const Product: React.FC = () => { .then((data) => setProductItem(data)) .catch((error) => { console.log(error); - navigate('/упс'); + navigate('/404'); }); } else { console.log('ID is undefined'); - navigate('/упс'); + navigate('/404'); } }, [id, navigate]);