Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 1999 Rev 2000
Línea 53... Línea 53...
53
        }finally{
53
        }finally{
54
            setLoading(false)
54
            setLoading(false)
55
        }
55
        }
56
    }
56
    }
Línea 57... Línea 57...
57
 
57
 
58
    const redirectToDashboard = () => {
58
    const logout = () => {
59
        window.location.href = '/';
59
        window.location.href = '/signout';
60
    }
60
    }
61
    const handleSubmit = async (e) => {
61
    const handleSubmit = async (e) => {
62
        try {
62
        try {
63
            e.preventDefault()
63
            e.preventDefault()
64
            setLoading(true)
64
            setLoading(true)
65
            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.data.message)
66
            handleAlert(res.data.success, res.data.data.message)
67
            if(res.data.success){
67
            if(res.data.success){
68
                redirectToDashboard()
68
                logout()
69
            }
69
            }
70
        } catch (error) {
70
        } catch (error) {
71
            handleAlert(false, 'Disculpe, ha ocurrido un error')
71
            handleAlert(false, 'Disculpe, ha ocurrido un error')
72
            console.log('>>: error > ', error)
72
            console.log('>>: error > ', error)