diff options
author | Lena <lena.becker-3@mni.thm.de> | 2021-03-11 22:27:08 +0100 |
---|---|---|
committer | Sascha <GlancingMind@outlook.com> | 2021-03-15 16:35:14 +0100 |
commit | 07f3163296b187ddf7069c05ca94f5ebaf43413c (patch) | |
tree | 810756be708479b4ab0b616384bf5c32007ca99a | |
parent | de26990afc9f21a9017b039ba9d7546a8d8ea5da (diff) | |
download | git-bug-07f3163296b187ddf7069c05ca94f5ebaf43413c.tar.gz |
#10 Add redirect to detail page after creating new bug
-rw-r--r-- | webui/src/pages/new/NewBugPage.tsx | 6 |
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 = ''; } |