Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 6775 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 6775 Rev 6907
Línea 6... Línea 6...
6
import { addNotification } from '../../redux/notification/notification.actions'
6
import { addNotification } from '../../redux/notification/notification.actions'
7
import { axios, CKEDITOR_OPTIONS } from '../../utils'
7
import { axios, CKEDITOR_OPTIONS } from '../../utils'
Línea 8... Línea 8...
8
 
8
 
9
import Spinner from '../UI/Spinner'
9
import Spinner from '../UI/Spinner'
-
 
10
import FormErrorFeedback from '../UI/FormErrorFeedback'
Línea 10... Línea 11...
10
import FormErrorFeedback from '../UI/FormErrorFeedback'
11
import { useLocation } from 'react-router-dom'
11
 
12
 
12
const OverviewModal = ({
13
const OverviewModal = ({
13
  isOpen = false,
14
  isOpen = false,
14
  overview = '',
15
  overview = '',
15
  id = '',
16
  id = '',
16
  closeModal = function () {},
17
  closeModal = function () {},
17
  onComplete = function () {},
18
  onComplete = function () {},
18
}) => {
19
}) => {
-
 
20
  const [loading, setLoading] = useState(false)
Línea 19... Línea 21...
19
  const [loading, setLoading] = useState(false)
21
  const dispatch = useDispatch()
Línea 20... Línea 22...
20
  const dispatch = useDispatch()
22
  const { pathname } = useLocation()
21
 
23
 
22
  const { register, errors, handleSubmit, setValue } = useForm()
24
  const { register, errors, handleSubmit, setValue } = useForm()
Línea 23... Línea 25...
23
 
25
 
-
 
26
  useEffect(() => {
-
 
27
    register('description', { required: 'Este campo es requerido' })
-
 
28
  }, [])
-
 
29
 
-
 
30
  const onSubmitHandler = async ({ description }) => {
-
 
31
    const typesUrl = {
24
  useEffect(() => {
32
      profile: `/profile/my-profiles/extended/${id}`,
Línea 25... Línea 33...
25
    register('description', { required: 'Este campo es requerido' })
33
      group: `/group/my-groups/extended/${id}`,
26
  }, [])
34
    }
Línea 27... Línea 35...
27
 
35
    const type = pathname.split('/')[1]
28
  const onSubmitHandler = async ({ description }) => {
36
 
29
    setLoading(true)
37
    setLoading(true)
30
 
38
 
31
    const formData = new FormData()
39
    const formData = new FormData()
32
    formData.append('description', description)
40
    formData.append('description', description)
33
 
41