Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6999 Rev 7239
Línea 83... Línea 83...
83
        dispatch(addNotification({ style: 'danger', msg: `Error: ${err}` }))
83
        dispatch(addNotification({ style: 'danger', msg: `Error: ${err}` }))
84
        throw new Error(err)
84
        throw new Error(err)
85
      })
85
      })
86
  }
86
  }
Línea -... Línea 87...
-
 
87
 
-
 
88
  const readAllNotification = () => {
-
 
89
    axios
-
 
90
      .post('notifications/mark-all-read')
-
 
91
      .then((response) => {
-
 
92
        const { data, success } = response.data
-
 
93
 
-
 
94
        if (!success) {
-
 
95
          dispatch(addNotification({ style: 'danger', msg: data }))
-
 
96
        }
-
 
97
      })
-
 
98
      .catch((err) => {
-
 
99
        dispatch(addNotification({ style: 'danger', msg: `Error: ${err}` }))
-
 
100
        throw new Error(err)
-
 
101
      })
-
 
102
  }
87
 
103
 
88
  const toggleConfirmModal = () => {
104
  const toggleConfirmModal = () => {
89
    setConfirmModalShow(!confirmModalShow)
105
    setConfirmModalShow(!confirmModalShow)
Línea 90... Línea 106...
90
  }
106
  }
Línea 109... Línea 125...
109
      })
125
      })
110
  }, [])
126
  }, [])
Línea 111... Línea 127...
111
 
127
 
112
  useLayoutEffect(() => {
128
  useLayoutEffect(() => {
-
 
129
    getNotifications()
113
    getNotifications()
130
    readAllNotification()
Línea 114... Línea 131...
114
  }, [])
131
  }, [])
115
 
132
 
116
  return (
133
  return (