diff --git a/src/containers/formulario/formulario-registro.tsx b/src/containers/formulario/formulario-registro.tsx index 134a060..dd64349 100644 --- a/src/containers/formulario/formulario-registro.tsx +++ b/src/containers/formulario/formulario-registro.tsx @@ -277,10 +277,42 @@ export default function FormularioRegistro({ '/cuestionario-respondido/submit', payload ); - toast.success(res.data.message || 'Formulario enviado correctamente'); + toast( + (t) => ( + + {res.data.message.includes('ya ha respondido') ? ( + <> + + {res.data.message} + + ) : ( + <> + + {res.data.message || '¡Formulario enviado!'} + + )} + + ), + { + duration: 6000, + position: 'bottom-center', + style: { + maxWidth: '425px', + }, + } + ); } catch (error) { console.log(getAxiosError(error)); - toast.error('Hubo un error al enviar el formulario'); + toast.error('Hubo un error al enviar el formulario', { + duration: 5000, + }); } finally { // Redirigir al usuario después de enviar el formulario router.push('/'); @@ -365,7 +397,7 @@ export default function FormularioRegistro({ ? 'Ingrese su RFC sin homoclave' : preguntaCuenta?.validacion === 'cuenta_trabajador' ? 'Ingrese su numero de trabajador' - : 'Ingrese su ' + preguntaCuenta.pregunta + : 'Ingrese su ' + preguntaCuenta.pregunta } maxLength={10} value={respuestas[preguntaCuenta.id_pregunta] || ''}