Skip to content

Commit

Permalink
feat: add 404 route
Browse files Browse the repository at this point in the history
  • Loading branch information
jsapro committed Jan 10, 2024
1 parent abe4deb commit e7e4aaf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function App() {
<Route path="favorites" element={<ProfileFavorites />} />
</Route>
<Route path={URLS.AGREEMENT} element={<Agreement />} />
<Route path="/404" element={<NotFound />} />
<Route path="*" element={<NotFound />} />
</Routes>
</Layout>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/category/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Category: React.FC = () => {
setCategoryObj(data.results[0]?.category);
})
.catch(() => {
navigate('/упс');
navigate('/404');
})
.finally(() => {
setIsLoading(false);
Expand Down
4 changes: 2 additions & 2 deletions src/pages/product/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down

0 comments on commit e7e4aaf

Please sign in to comment.