From 226325062ee8773e35b47b2524a13f1268355ad7 Mon Sep 17 00:00:00 2001 From: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Date: Fri, 22 Nov 2024 17:23:15 -0500 Subject: [PATCH] Conditionally get the first assignment reason (#17808) --- packages/app-store/routing-forms/trpc/report.handler.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/app-store/routing-forms/trpc/report.handler.ts b/packages/app-store/routing-forms/trpc/report.handler.ts index 4cd7adf968..63adfb37d8 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), ];