aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/pages
diff options
context:
space:
mode:
authorLena <lena.becker-3@mni.thm.de>2021-03-11 22:27:08 +0100
committerSascha <GlancingMind@outlook.com>2021-03-15 16:35:14 +0100
commit07f3163296b187ddf7069c05ca94f5ebaf43413c (patch)
tree810756be708479b4ab0b616384bf5c32007ca99a /webui/src/pages
parentde26990afc9f21a9017b039ba9d7546a8d8ea5da (diff)
downloadgit-bug-07f3163296b187ddf7069c05ca94f5ebaf43413c.tar.gz
#10 Add redirect to detail page after creating new bug
Diffstat (limited to 'webui/src/pages')
-rw-r--r--webui/src/pages/new/NewBugPage.tsx6
1 files changed, 6 insertions, 0 deletions
diff --git a/webui/src/pages/new/NewBugPage.tsx b/webui/src/pages/new/NewBugPage.tsx
index a46226ad..9ad52ad0 100644
--- a/webui/src/pages/new/NewBugPage.tsx
+++ b/webui/src/pages/new/NewBugPage.tsx
@@ -1,4 +1,5 @@
import React, { FormEvent, useState } from 'react';
+import { useHistory } from 'react-router-dom';
import { Button } from '@material-ui/core';
import Paper from '@material-ui/core/Paper';
@@ -43,7 +44,9 @@ function NewBugPage() {
const [issueTitle, setIssueTitle] = useState('');
const [issueComment, setIssueComment] = useState('');
const classes = useStyles();
+
let issueTitleInput: any;
+ let history = useHistory();
function submitNewIssue(e: FormEvent) {
e.preventDefault();
@@ -55,6 +58,9 @@ function NewBugPage() {
message: issueComment,
},
},
+ }).then(function (data) {
+ const id = data.data?.newBug.bug.humanId;
+ history.push('/bug/' + id);
});
issueTitleInput.value = '';
}