File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
src/apps/copilots/src/pages/copilot-request-form Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 11import { FC , useContext , useMemo , useState } from 'react'
22import { bind , debounce , isEmpty } from 'lodash'
33import { toast } from 'react-toastify'
4+ import { useNavigate } from 'react-router-dom'
45import classNames from 'classnames'
56
67import { profileContext , ProfileContextData } from '~/libs/core'
@@ -16,6 +17,7 @@ import styles from './styles.module.scss'
1617// eslint-disable-next-line
1718const 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 )
You can’t perform that action at this time.
0 commit comments