Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 7212 Rev 7213
Línea 1... Línea 1...
1
import React, { useEffect, useRef, useState } from 'react'
1
import React, { useEffect, useRef, useState } from 'react'
2
import { axios } from '../../utils'
2
import { axios } from '../../utils'
3
import { useLocation } from 'react-router-dom'
3
import { useHistory, useLocation } from 'react-router-dom'
4
import { addNotification } from '../../redux/notification/notification.actions'
4
import { addNotification } from '../../redux/notification/notification.actions'
5
import { useDispatch, useSelector } from 'react-redux'
5
import { useDispatch, useSelector } from 'react-redux'
6
import { Col, Container, Row } from 'react-bootstrap'
6
import { Col, Container, Row } from 'react-bootstrap'
7
import QuestionCard from '../../components/my-coach/QuestionCard'
7
import QuestionCard from '../../components/my-coach/QuestionCard'
8
import ConfirmModal from '../../components/modals/ConfirmModal'
8
import ConfirmModal from '../../components/modals/ConfirmModal'
Línea 13... Línea 13...
13
  const addUrl = useRef('')
13
  const addUrl = useRef('')
14
  const actionUrl = useRef('')
14
  const actionUrl = useRef('')
15
  const labels = useSelector(({ intl }) => intl.labels)
15
  const labels = useSelector(({ intl }) => intl.labels)
16
  const dispatch = useDispatch()
16
  const dispatch = useDispatch()
17
  const { pathname } = useLocation()
17
  const { pathname } = useLocation()
-
 
18
  const history = useHistory()
Línea 18... Línea 19...
18
 
19
 
19
  const getQuestion = () => {
20
  const getQuestion = () => {
20
    axios
21
    axios
21
      .get(pathname, {
22
      .get(pathname, {
Línea 64... Línea 65...
64
 
65
 
65
          dispatch(addNotification({ style: 'danger', msg: errorMessage }))
66
          dispatch(addNotification({ style: 'danger', msg: errorMessage }))
66
          return
67
          return
Línea 67... Línea -...
67
        }
-
 
68
 
68
        }
-
 
69
 
-
 
70
        closeModal()
69
        dispatch(addNotification({ style: 'success', msg: data }))
71
        dispatch(addNotification({ style: 'success', msg: data }))
70
        closeModal()
72
        history.goBack()
71
      })
73
      })
72
      .catch((error) => {
74
      .catch((error) => {
73
        dispatch(
75
        dispatch(
Línea 103... Línea 105...
103
    <>
105
    <>
104
      <Container as="section" className="companies-info">
106
      <Container as="section" className="companies-info">
105
        <div className="company-title">
107
        <div className="company-title">
106
          <h1 className="title mx-auto">{labels.my_coach}</h1>
108
          <h1 className="title mx-auto">{labels.my_coach}</h1>
107
        </div>
109
        </div>
108
 
-
 
109
        <Row>
110
        <Row>
110
          <Col md="8" className="mx-auto">
111
          <Col md="8" className="mx-auto">
111
            <QuestionCard
112
            <QuestionCard
112
              key={question.uuid}
113
              key={question.uuid}
113
              onEdit={editQuestion}
114
              onEdit={editQuestion}