Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 2014 Rev 2015
Línea 60... Línea 60...
60
        window.location.href = '/signout';
60
        window.location.href = '/signout';
61
    }
61
    }
62
    const handleSubmit = async (e) => {
62
    const handleSubmit = async (e) => {
63
        try {
63
        try {
64
            e.preventDefault()
64
            e.preventDefault()
65
            console.log('>>: e >', e)
-
 
66
            const data = new FormData();
65
            const data = new FormData();
67
            data.append('code', code)
66
            data.append('code', code)
68
            console.log('>>: data > ', data)
-
 
69
            setLoading(true)
67
            setLoading(true)
70
            const res = await axios.post('/account-settings/delete-account', data);
68
            const res = await axios.post('/account-settings/delete-account', data);
71
            handleAlert(res.data.success, res.data.data.message)
69
            handleAlert(res.data.success, res.data.data.message)
72
            // if(res.data.success){
70
            if(res.data.success){
73
            //     logout()
71
                logout()
74
            // }
72
            }
75
        } catch (error) {
73
        } catch (error) {
76
            handleAlert(false, 'Disculpe, ha ocurrido un error')
74
            handleAlert(false, 'Disculpe, ha ocurrido un error')
77
            console.log('>>: error > ', error)
75
            console.log('>>: error > ', error)
78
        }finally{
76
        }finally{
79
            setLoading(false)
77
            setLoading(false)