fix: eventName variables (#10924)

pull/11223/head^2
Udit Takkar 2023-09-08 02:22:07 +05:30 committed by GitHub
parent 95be16c358
commit f326a9a620
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -57,8 +57,12 @@ export function getEventName(eventNameObj: EventNameObjectType, forAttendeeView
if (variable === bookingField) { if (variable === bookingField) {
let fieldValue; let fieldValue;
if (eventNameObj.bookingFields) { if (eventNameObj.bookingFields) {
fieldValue = const field = eventNameObj.bookingFields[bookingField as keyof typeof eventNameObj.bookingFields];
eventNameObj.bookingFields[bookingField as keyof typeof eventNameObj.bookingFields]?.toString(); if (field && typeof field === "object" && "value" in field) {
fieldValue = field?.value?.toString();
} else {
fieldValue = field?.toString();
}
} }
dynamicEventName = dynamicEventName.replace(`{${variable}}`, fieldValue || ""); dynamicEventName = dynamicEventName.replace(`{${variable}}`, fieldValue || "");
} }