fix: Fixed email embed for team when specific times are chosen embeds the wrong URL (#14975)

* Fixed team embed url

* Added comments

---------

Co-authored-by: borawakevikrant <borawakevikrant@gmail.com>
This commit is contained in:
vikrant845
2024-05-10 14:05:09 +00:00
committed by GitHub
co-authored by borawakevikrant
parent 83e15c4ce1
commit 039bf6d4e3
+7 -1
View File
@@ -418,7 +418,13 @@ const EmailEmbedPreview = ({
<tr style={{ height: "25px" }}>
{selectedDateAndTime[key]?.length > 0 &&
selectedDateAndTime[key].map((time) => {
const bookingURL = `${WEBSITE_URL}/${username}/${eventType.slug}?duration=${eventType.length}&date=${key}&month=${month}&slot=${time}`;
// If teamId is present on eventType and is not null, it means it is a team event.
// So we add 'team/' to the url.
const bookingURL = `${WEBSITE_URL}/${
eventType.teamId !== null ? "team/" : ""
}${username}/${eventType.slug}?duration=${
eventType.length
}&date=${key}&month=${month}&slot=${time}`;
return (
<td
key={time}