Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

308
Vistas
check email id already exists with using yup validation wrrong url how change setting

i try to use formik form with yup validation to see if a email already exist in database (i have a nestjs back on the port 8000 and my react front on the port 3000) so i do this:

  const validationSchema = Yup.object().shape({
    username: Yup.string()
      .min(2, 'votre surnom doit contenir minimum 2 caractères')
      .max(30, '30 caractères maximum autorisés')
      .required('Veuillez renseigner un pseudo'),
    email: Yup.string()
      .email('Veuillez renseigner une adresse mail valide')
      .required('Ce champs est obligatoire.')
      .test(
        'email check',
        'email déjà utiliser',
        async (value) =>
          await fetch('http:localhost:8000/users/check_email', {
            method: 'POST',
            headers: {
              'Content-type': 'application/json'
            },
            body: JSON.stringify({ email: value })
          }).then((res) => res.json())
      ),

but when i try to test the email validation i got this error in the console

POST http://localhost:3000/localhost:8000/users/check_email 404 (Not Found)

so how i can change the settings of yup or react to not do this.

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

You should correct the http protocol in your url from http:localhost:8000/ to http://localhost:8000 so that http://localhost:3000 does not get added at the start of the url.

about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda