Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

309
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda