Hi, I want to create register form with 4 slots. After slots are filled I want to make request to external API with data from slots. How to handle situation when the response is for example: 409 ALREADY USED EMAIL? In this scenario I want to reset email slot after this request and go back to the form. But my problem is that there is no place in form to make request and not leave form. I can make this request only when all slots are filled. Also I want this to work in a loop (user can provide already used email more than one time).
Is there any way of solving this situation without creating loops with checkpoints?
I think there are several possibilities to handle this:
Use the validator-method of the last slot after it has been filled to submit and get the feedback. If it fails like in your scenario, reset the form, the slots or proceed the way you want.
Overwrite the validate_slots-method in your actions.py if you don’t want to do it on slot-level as mentioned in option 1.