fix: display all responses (#13999)

* fix: display all responses

* fix: type err

* chore: rename variable
This commit is contained in:
Udit Takkar authored and GitHub committed 2024-03-12 15:30:02 +00:00
1 parent 4585199b5e
commit 8402dfa3a2
5 files changed
+24 -4

No files matched your search

@@ -16,7 +16,7 @@ export function UserFieldsResponses(props: { calEvent: CalendarEvent; t: TFuncti
labelValueMap[key] !== "" ? (
<Info
key={key}
label={key}
label={t(key)}
description={
typeof labelValueMap[key] === "boolean"
? labelValueMap[key]
@@ -12,3 +12,4 @@ export const SystemField = z.enum([
]);
export const SMS_REMINDER_NUMBER_FIELD = "smsReminderNumber";
export const TITLE_FIELD = "title";
@@ -2069,6 +2069,7 @@ async function handler(
calEvent: getPiiFreeCalendarEvent(evt),
})
);
await sendScheduledEmails(
{
...evt,
@@ -1,13 +1,20 @@
import type z from "zod";
import { TITLE_FIELD } from "@calcom/features/bookings/lib/SystemField";
import type { bookingResponse } from "@calcom/features/bookings/lib/getBookingResponsesSchema";
import type { CalendarEvent } from "@calcom/types/Calendar";
export default function getLabelValueMapFromResponses(calEvent: CalendarEvent) {
const { customInputs, userFieldsResponses } = calEvent;
const { customInputs, userFieldsResponses, responses, eventTypeId } = calEvent;
const isDynamicEvent = !eventTypeId;
let labelValueMap: Record<string, z.infer<typeof bookingResponse>> = {};
if (userFieldsResponses) {
if (!!responses?.[TITLE_FIELD] && !isDynamicEvent) {
userFieldsResponses[TITLE_FIELD] = responses[TITLE_FIELD];
}
for (const [, value] of Object.entries(userFieldsResponses)) {
if (!value.label) {
continue;