aboutsummaryrefslogtreecommitdiffstats
path: root/webui
diff options
context:
space:
mode:
authorLena <lena.becker-3@mni.thm.de>2021-03-02 20:15:39 +0100
committerSascha <GlancingMind@outlook.com>2021-03-15 16:35:14 +0100
commit46d38aa53fa925a2335fdf6c3b0b6f47d05dce94 (patch)
tree907fcdf81ebdb5d424d0c51512fce6810fb7c5d2 /webui
parentec8a9b20696da25bf1781dd190e7ec6a8fbf5687 (diff)
downloadgit-bug-46d38aa53fa925a2335fdf6c3b0b6f47d05dce94.tar.gz
Route instead of Redirect from empty bug to 404 after a hint from GM #10
Diffstat (limited to 'webui')
-rw-r--r--webui/src/App.tsx1
-rw-r--r--webui/src/pages/bug/BugQuery.tsx6
2 files changed, 4 insertions, 3 deletions
diff --git a/webui/src/App.tsx b/webui/src/App.tsx
index e0580b1d..4c81913c 100644
--- a/webui/src/App.tsx
+++ b/webui/src/App.tsx
@@ -13,7 +13,6 @@ export default function App() {
<Switch>
<Route path="/" exact component={ListPage} />
<Route path="/new" exact component={NewBugPage} />
- <Route path="/404bug" exact component={NotFoundPage} />
<Route path="/bug/:id" exact component={BugPage} />
<Route component={NotFoundPage} />
</Switch>
diff --git a/webui/src/pages/bug/BugQuery.tsx b/webui/src/pages/bug/BugQuery.tsx
index ade64e9d..5d459c42 100644
--- a/webui/src/pages/bug/BugQuery.tsx
+++ b/webui/src/pages/bug/BugQuery.tsx
@@ -1,8 +1,10 @@
import React from 'react';
-import { Redirect, RouteComponentProps } from 'react-router-dom';
+import { RouteComponentProps } from 'react-router-dom';
import CircularProgress from '@material-ui/core/CircularProgress';
+import NotFoundPage from '../notfound/NotFoundPage';
+
import Bug from './Bug';
import { useGetBugQuery } from './BugQuery.generated';
@@ -15,7 +17,7 @@ const BugQuery: React.FC<Props> = ({ match }: Props) => {
variables: { id: match.params.id },
});
if (loading) return <CircularProgress />;
- if (!data?.repository?.bug) return <Redirect to="/404bug" />;
+ if (!data?.repository?.bug) return <NotFoundPage />;
if (error) return <p>Error: {error}</p>;
return <Bug bug={data.repository.bug} />;
};