Skip to content

Commit 80720e7

Browse files
authored
Merge pull request #1129 from topcoder-platform/pm-1322
fix(PM-1322): Redirect to requests page once copilot request is created
2 parents f4cee24 + fa09b18 commit 80720e7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ workflows:
222222
- LVT-256
223223
- CORE-635
224224
- feat/system-admin
225-
- pm-1464
225+
- pm-1322
226226

227227
- deployQa:
228228
context: org-global

src/apps/copilots/src/pages/copilot-request-form/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { FC, useContext, useMemo, useState } from 'react'
22
import { bind, debounce, isEmpty } from 'lodash'
33
import { toast } from 'react-toastify'
4+
import { useNavigate } from 'react-router-dom'
45
import classNames from 'classnames'
56

67
import { profileContext, ProfileContextData } from '~/libs/core'
@@ -16,6 +17,7 @@ import styles from './styles.module.scss'
1617
// eslint-disable-next-line
1718
const CopilotRequestForm: FC<{}> = () => {
1819
const { profile }: ProfileContextData = useContext(profileContext)
20+
const navigate = useNavigate()
1921

2022
const [formValues, setFormValues] = useState<any>({})
2123
const [isFormChanged, setIsFormChanged] = useState(false)
@@ -217,6 +219,10 @@ const CopilotRequestForm: FC<{}> = () => {
217219
setIsFormChanged(false)
218220
setFormErrors({})
219221
setPaymentType('')
222+
// Added a small timeout for the toast to be visible properly to the users
223+
setTimeout(() => {
224+
navigate('/requests')
225+
}, 1000)
220226
})
221227
.catch(e => {
222228
toast.error(e.message)

0 commit comments

Comments
 (0)