feat: add availabilityLoaded embed event (#21350)
* feat: add availabiityLoaded embed event * chore * fix --------- Co-authored-by: Volnei Munhoz <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]> Co-authored-by: Devanshu Sharma <[email protected]>
This commit is contained in:
4 files changed
+68
No files matched your search
@@ -50,6 +50,24 @@ function App() {
|
||||
callback,
|
||||
});
|
||||
|
||||
const availabilityLoadedCallback = (e: EmbedEvent<"availabilityLoaded">) => {
|
||||
const data = e.detail.data;
|
||||
console.log("availabilityLoaded", {
|
||||
eventId: data.eventId,
|
||||
eventSlug: data.eventSlug,
|
||||
});
|
||||
|
||||
api("off", {
|
||||
action: "availabilityLoaded",
|
||||
callback: availabilityLoadedCallback,
|
||||
});
|
||||
};
|
||||
|
||||
api("on", {
|
||||
action: "availabilityLoaded",
|
||||
callback: availabilityLoadedCallback,
|
||||
});
|
||||
|
||||
// Also, validates the type of e.detail.data as TS runs on this file
|
||||
const bookingSuccessfulV2Callback = (e: EmbedEvent<"bookingSuccessfulV2">) => {
|
||||
const data = e.detail.data;
|
||||
|
||||
Reference in new issue
Block a user