Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3374 Rev 3378
Línea 18... Línea 18...
18
  const { data, isLoading, refetch } = useFetch(dailyPulseUrl, {
18
  const { data, isLoading, refetch } = useFetch(dailyPulseUrl, {
19
    emojis_how_are_you_feel: [],
19
    emojis_how_are_you_feel: [],
20
    emojis_climate_on_your_organization: []
20
    emojis_climate_on_your_organization: []
21
  })
21
  })
Línea 22... Línea -...
22
 
-
 
23
  /*  const updateEmojis = (id) => {
-
 
24
    const isClimate = data.emojis_climate_on_your_organization.some(
-
 
25
      (emoji) => emoji.id === id
-
 
26
    )
-
 
27
 
-
 
28
    if (isClimate) {
-
 
29
      data.emojis_climate_on_your_organization.filter(
-
 
30
        (emoji) => emoji.id === id
-
 
31
      )
-
 
32
    }
-
 
33
  } */
-
 
34
 
22
 
35
  const saveEmoji = async (link_save = '') => {
23
  const saveEmoji = async (link_save = '') => {
36
    try {
24
    try {
37
      setIsSubmitting(true)
25
      setIsSubmitting(true)
38
      const response = await axios.post(link_save)
26
      const response = await axios.post(link_save)
Línea 39... Línea 27...
39
      const { data, success } = response.data
27
      const { data, success } = response.data
40
 
28
 
41
      if (!success) {
29
      if (!success) {
42
        const errMsg = typeof data === 'string' ? data : 'Ha ocurrido un error'
30
        const errMsg = typeof data === 'string' ? data : 'Error al guardar'
Línea 43... Línea 31...
43
        throw new Error(errMsg)
31
        throw new Error(errMsg)
44
      }
32
      }
Línea 49... Línea 37...
49
    } finally {
37
    } finally {
50
      setIsSubmitting(false)
38
      setIsSubmitting(false)
51
    }
39
    }
52
  }
40
  }
Línea -... Línea 41...
-
 
41
 
-
 
42
  if (
-
 
43
    data.emojis_how_are_you_feel <= 1 &&
-
 
44
    data.emojis_climate_on_your_organization <= 1
-
 
45
  ) {
-
 
46
    return null
-
 
47
  }
53
 
48
 
54
  return (
49
  return (
55
    <Widget>
50
    <Widget>
Línea 56... Línea 51...
56
      <Widget.Header title='Pulso Diario' />
51
      <Widget.Header title='Pulso Diario' />