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

133
Vistas
API function doesn't run

I have following api function:

    value = req.body;
    initalBoardID = value.model.id;
    value = value.action;
    type = value.type;
    translationKey = value.display.translationKey;
    res.status(200).json("Okay");
   if (
      type == "addMemberToCard" &&
      translationKey == "action_member_joined_card"
    ) {
      member = value.display.entities.memberCreator.id;
      createCard();
    }
  } else {
    res.status(200).json("Function works");
  }

When I send a POST request to the above function I get the status 200 but the code doesn't continue.

I have also an api function to get some inforamtion and errors.

When I call this function the code continues. But I don't call any function to log a information or an error of this api.

Do you know why the code doesn't continue from the beginning? Only when I call another api which does not log any information and errors?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If I read things correctly, if you send res.status or res.json, you can't send another response. Also if you send response, the code breaks, so it doesn't go far more, so as you have res.status etc. and then createCard() won't run because the function stops after sending response...

about 4 years ago · Juan Pablo Isaza 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