File: /var/www/vhost/disk-apps/alq-cali.bikenow.co/public/js/delete_account.js
function formHandler() {
return {
nombre: '',
documento: '',
correo: '',
mostrarAlerta: false,
cargando: false,
errors: {},
validateForm() {
this.errors = {};
let isValid = true;
if (!this.nombre) {
this.errors.nombre = 'El nombre es requerido.';
isValid = false;
}
if (!this.documento) {
this.errors.documento = 'El documento es requerido.';
isValid = false;
}
if (!this.correo) {
this.errors.correo = 'El correo es requerido.';
isValid = false;
}
return isValid;
},
submitForm() {
if (this.validateForm()) {
this.cargando = true;
setTimeout(() => {
this.cargando = false;
this.mostrarAlerta = true;
this.nombre = '';
this.documento = '';
this.correo = '';
}, 1000);
}
}
};
}