interceptBooking
function that will be passed to the Booker atom handleCreateBooking
hook. See Booker atom docs on how to use it - in this tutorial
we focus on the handleCreateBooking
hook.
- When user clicks “Book” in the Booker atom the booking will not happen. Instead, the
interceptBooking
function will be called and will receive all the booking data. - Then, you can hide the Booker component and instead render another component, show a modal, redirect to a new page or whatever you want to do.
- After your custom action is finished, extract the necessary information from the booking data passed to
interceptBooking
and make a POST request to create booking endpoint to actually create the booking.