Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 7790 Rev 7792
Línea 26... Línea 26...
26
        if (!url && onComplete) {
26
        if (!url && onComplete) {
27
            return onComplete()
27
            return onComplete()
28
        }
28
        }
Línea 29... Línea 29...
29
 
29
 
30
        axios.post(url)
30
        axios.post(url)
31
            .then(async ({ data }) => {
31
            .then(({ data }) => {
32
                if (data.success) {
-
 
33
                    try {
32
                if (data.success) {
34
                        action && dispatch(action())
33
                    action && dispatch(action())
35
                        onComplete && onComplete()
-
 
36
                        dispatch(addNotification({
-
 
37
                            style: "success",
-
 
38
                            msg: message ? message : 'Eliminado correctamente'
-
 
Línea 39... Línea 34...
39
                        }))
34
                    onComplete && onComplete()
40
 
-
 
-
 
35
 
41
                        closeModal()
36
                    closeModal()
42
                    }
37
 
43
                    catch (err) { dispatch(addNotification({
38
                    dispatch(addNotification({
44
                        style: "error",
39
                        style: "success",
45
                        msg: "Ha ocurrido un error"
40
                        msg: data.data
46
                    })) }
41
                    }))
47
                }
42
                }
-
 
43
            })
-
 
44
            .catch((err) => dispatch(addNotification({
-
 
45
                style: "danger",
48
            })
46
                msg: "Ha ocurrido un error"
Línea 49... Línea 47...
49
            .catch((err) => console.log(err))
47
            })))
50
    };
48
    };
51
 
49