Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 5 Rev 655
Línea 21... Línea 21...
21
 
21
 
22
        if (!success) {
22
        if (!success) {
23
          dispatch(
23
          dispatch(
24
            addNotification({
24
            addNotification({
25
              style: 'danger',
25
              style: 'danger',
26
              message: 'Ha ocurrido un error, por favor intente más tarde.',
26
              message: 'Ha ocurrido un error, por favor intente más tarde.'
27
            })
27
            })
28
          )
28
          )
29
          return
29
          return
Línea 30... Línea 30...
30
        }
30
        }
31
 
31
 
32
        onClose()
32
        onClose()
33
      })
-
 
34
      .catch((error) => {
-
 
35
        dispatch(
-
 
36
          addNotification({
33
      })
37
            style: 'danger',
-
 
38
            message: 'Ha ocurrido un error, por favor intente más tarde.',
-
 
39
          })
-
 
40
        )
34
      .catch((err) => {
41
        throw new Error(error)
35
        dispatch(addNotification({ style: 'danger', message: err.message }))
Línea 42... Línea 36...
42
      })
36
      })
43
  }
37
  }
44
 
38
 
45
  return (
39
  return (
46
    <Modal show={isOpen} onHide={onClose}>
40
    <Modal show={isOpen} onHide={onClose}>
47
      <Modal.Header closeButton>
41
      <Modal.Header closeButton>
48
        <Modal.Title>Crear grupo</Modal.Title>
42
        <Modal.Title>Crear grupo</Modal.Title>
49
      </Modal.Header>
43
      </Modal.Header>
50
      <Modal.Body>
44
      <Modal.Body>
51
        <form onSubmit={handleSubmit(onSubmitHandler)}>
45
        <form onSubmit={handleSubmit(onSubmitHandler)}>
52
          <label className="mb-1" htmlFor="name">
46
          <label className='mb-1' htmlFor='name'>
53
            Nombre del grupo
47
            Nombre del grupo
54
          </label>
48
          </label>
55
          <input
49
          <input
56
            type="text"
50
            type='text'
57
            name="name"
51
            name='name'
58
            id="name"
52
            id='name'
59
            ref={register({ required: 'Este campo es requerido' })}
53
            ref={register({ required: 'Este campo es requerido' })}
60
          />
54
          />
61
          {errors.name && (
55
          {errors.name && (
62
            <FormErrorFeedback>{errors.name.message}</FormErrorFeedback>
56
            <FormErrorFeedback>{errors.name.message}</FormErrorFeedback>
63
          )}
57
          )}
64
          <div className="mt-3 d-flex gap-3">
58
          <div className='mt-3 d-flex gap-3'>
65
            <button className="btn btn-primary" type="submit">
59
            <button className='btn btn-primary' type='submit'>
66
              Enviar
60
              Enviar
67
            </button>
61
            </button>
68
            <button className="btn btn-secondary" onClick={onClose}>
62
            <button className='btn btn-secondary' onClick={onClose}>
69
              Cancelar
63
              Cancelar
70
            </button>
64
            </button>