Validacion en la asistencia del usuario
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ const nextConfig: NextConfig = {
|
||||
{
|
||||
protocol: 'http',
|
||||
hostname: 'localhost',
|
||||
port: '4200',
|
||||
port: '3342', //4200
|
||||
},
|
||||
{
|
||||
protocol: 'https',
|
||||
|
||||
@@ -61,10 +61,18 @@ export default function Page() {
|
||||
}
|
||||
);
|
||||
|
||||
setParticipante(response.data.data.participante);
|
||||
setMessage(response.data.message);
|
||||
console.log('Asistencia registrada:', response.data);
|
||||
toast.success('✅ Asistencia registrada correctamente');
|
||||
//Validacion
|
||||
if(response.data.success === false) {
|
||||
console.error("El usuario ya se registro");
|
||||
setMessage(response.data.message);
|
||||
toast.error("❌ Error el usaurio ya se registro previamente.")
|
||||
} else {
|
||||
setParticipante(response.data.data.participante);
|
||||
setMessage(response.data.message);
|
||||
console.log('Asistencia registrada:', response.data);
|
||||
toast.success('✅ Asistencia registrada correctamente');
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
console.error('Error en la petición:', err);
|
||||
setStatusMessage('❌ Error de red al registrar asistencia');
|
||||
|
||||
Reference in New Issue
Block a user