Skip to content

Scheduling infrastructure for absolutely everyone.

Conditionally get the first assignment reason (#17808)

Joe Au-Yeung226325062ee8
diff --git a/packages/app-store/routing-forms/trpc/report.handler.ts b/packages/app-store/routing-forms/trpc/report.handler.ts
index 4cd7adf9685..63adfb37d82 100644
--- a/packages/app-store/routing-forms/trpc/report.handler.ts
+++ b/packages/app-store/routing-forms/trpc/report.handler.ts
@@ -135,7 +135,9 @@ function presenter(args: {
return [
...r,
currentRow.routedToBooking?.user?.email || "",
- currentRow.routedToBooking?.assignmentReason[0].reasonString || "",
+ currentRow.routedToBooking?.assignmentReason.length
+ ? currentRow.routedToBooking.assignmentReason[0].reasonString
+ : "",
currentRow.routedToBooking?.createdAt ? formatDate(currentRow.routedToBooking.createdAt) : "",
formatDate(currentRow.createdAt),
];