Response message

Options
Hello! I have an endpoint which adds/updates a contact in db (endpoint) + sends an email if some conditions are met (custom function).

"Email sending" custom function is a part of the endpoint's flow.
It has a precondition that determines if an email must go out or not.

I want the endpoint to respond with "Ok" no matter how the custom function worked. Right now every time the precondition on that custom function is not met, the response is overridden with "Precondition failed". How to avoid it?

Thanks.

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     I would use a Conditional (IF.. THEN.. ELSE..) function in lieu of the precondition. This way you can have your response always be "Ok" as the precondition will trigger an error when it is not met. 
  • Valentin R
    Valentin R Member
    Options
     thanks Michael. Will try that.
    And thanks for all the videos, I've seen a bunch so far and they are really helpful.
  • Valentin R
    Valentin R Member
    Options
    Works well!