Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2194 | Rev 2806 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 2194 Rev 2614
Línea 1... Línea 1...
1
import React, { useEffect, useRef, useState } from 'react'
1
import React, { useEffect, useRef, useState } from 'react'
2
import { useHistory, useLocation } from 'react-router-dom'
2
import { useNavigate, useLocation } from 'react-router-dom'
3
import { useDispatch, useSelector } from 'react-redux'
3
import { useDispatch, useSelector } from 'react-redux'
Línea 4... Línea 4...
4
 
4
 
5
import { axios } from '../../utils'
5
import { axios } from '../../utils'
Línea 20... Línea 20...
20
  const addUrl = useRef('')
20
  const addUrl = useRef('')
21
  const actionUrl = useRef('')
21
  const actionUrl = useRef('')
22
  const labels = useSelector(({ intl }) => intl.labels)
22
  const labels = useSelector(({ intl }) => intl.labels)
23
  const dispatch = useDispatch()
23
  const dispatch = useDispatch()
24
  const { pathname } = useLocation()
24
  const { pathname } = useLocation()
25
  const history = useHistory()
25
  const navigate = useNavigate()
Línea 26... Línea 26...
26
 
26
 
27
  const getQuestion = () => {
27
  const getQuestion = () => {
28
    axios
28
    axios
29
      .get(pathname, {
29
      .get(pathname, {
Línea 68... Línea 68...
68
          return
68
          return
69
        }
69
        }
Línea 70... Línea 70...
70
 
70
 
71
        closeModal()
71
        closeModal()
72
        dispatch(addNotification({ style: 'success', msg: data }))
72
        dispatch(addNotification({ style: 'success', msg: data }))
73
        history.replace('/my-coach')
73
        navigate('/my-coach')
74
      })
74
      })
75
      .catch((error) => {
75
      .catch((error) => {
76
        dispatch(addNotification({ style: 'danger', msg: error.message }))
76
        dispatch(addNotification({ style: 'danger', msg: error.message }))
77
      })
77
      })