Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 1994 Rev 1995
Línea 53... Línea 53...
53
        }finally{
53
        }finally{
54
            setLoading(false)
54
            setLoading(false)
55
        }
55
        }
56
    }
56
    }
Línea -... Línea 57...
-
 
57
 
-
 
58
    const redirectToDashboard = () => {
-
 
59
        window.location.href = '/';
57
 
60
    }
58
    const handleSubmit = async (e) => {
61
    const handleSubmit = async (e) => {
59
        try {
62
        try {
60
            e.preventDefault()
63
            e.preventDefault()
61
            setLoading(true)
64
            setLoading(true)
62
            const res = await axios.post('/account-settings/delete-account');
65
            const res = await axios.post('/account-settings/delete-account');
-
 
66
            handleAlert(res.data.success, res.data.message)
63
            handleAlert(res.data.success, res.data.message)
67
            if(res.data.success){
-
 
68
                redirectToDashboard()
64
            console.log('>>: res > ', res)
69
            }
65
        } catch (error) {
70
        } catch (error) {
66
            handleAlert(false, 'Disculpe, ha ocurrido un error')
71
            handleAlert(false, 'Disculpe, ha ocurrido un error')
67
            console.log('>>: error > ', error)
72
            console.log('>>: error > ', error)
68
        }finally{
73
        }finally{