Skip to content

Scheduling infrastructure for absolutely everyone.

show who a RR was reassigned to on auto (#17454)

sean-brydonf1111c9d4232
diff --git a/apps/web/components/dialog/ReassignDialog.tsx b/apps/web/components/dialog/ReassignDialog.tsx
index e966c397acc..ca5ab4c7fb7 100644
--- a/apps/web/components/dialog/ReassignDialog.tsx
+++ b/apps/web/components/dialog/ReassignDialog.tsx
@@ -106,10 +106,10 @@ export const ReassignDialog = ({ isOpenDialog, setIsOpenDialog, teamId, bookingI
});
const roundRobinReassignMutation = trpc.viewer.teams.roundRobinReassign.useMutation({
- onSuccess: async () => {
+ onSuccess: async (data) => {
await utils.viewer.bookings.get.invalidate();
setIsOpenDialog(false);
- showToast(t("booking_reassigned"), "success");
+ showToast(t("booking_reassigned_to_host", { host: data?.reassignedTo.name }), "success");
},
onError: async (error) => {
if (error.message.includes(ErrorCode.NoAvailableUsersFound)) {
diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json
index 06eff9133d5..67406948f44 100644
--- a/apps/web/public/static/locales/en/common.json
+++ b/apps/web/public/static/locales/en/common.json
@@ -2744,5 +2744,6 @@
"event_end_time_in_attendee_timezone_info": "Event End Time In Attendee Timezone",
"salesforce_create_event_on_contact": "Create event on contact, if it exists. Else fallback to lead",
"salesforce_owner_name_to_change": "Owner name to change",
+ "booking_reassigned_to_host": "Booking reassigned to {{host}}",
"ADD_NEW_STRINGS_ABOVE_THIS_LINE_TO_PREVENT_MERGE_CONFLICTS": "↑↑↑↑↑↑↑↑↑↑↑↑↑ Add your new strings above here ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑"
}
diff --git a/packages/features/ee/round-robin/roundRobinReassignment.ts b/packages/features/ee/round-robin/roundRobinReassignment.ts
index a6f7153ec22..063e52f3aa2 100644
--- a/packages/features/ee/round-robin/roundRobinReassignment.ts
+++ b/packages/features/ee/round-robin/roundRobinReassignment.ts
@@ -519,6 +519,15 @@ export const roundRobinReassignment = async ({
hideBranding: !!eventType?.owner?.hideBranding,
});
}
+
+ return {
+ bookingId,
+ reassignedTo: {
+ id: reassignedRRHost.id,
+ name: reassignedRRHost.name,
+ email: reassignedRRHost.email,
+ },
+ };
};
export default roundRobinReassignment;
diff --git a/packages/trpc/server/routers/viewer/teams/roundRobin/roundRobinReassign.handler.ts b/packages/trpc/server/routers/viewer/teams/roundRobin/roundRobinReassign.handler.ts
index ccf357af22d..46b85fac15a 100644
--- a/packages/trpc/server/routers/viewer/teams/roundRobin/roundRobinReassign.handler.ts
+++ b/packages/trpc/server/routers/viewer/teams/roundRobin/roundRobinReassign.handler.ts
@@ -23,7 +23,7 @@ export const roundRobinReassignHandler = async ({ ctx, input }: RoundRobinReassi
throw new TRPCError({ code: "FORBIDDEN", message: "You do not have permission" });
}
- await roundRobinReassignment({ bookingId, orgId: ctx.user.organizationId });
+ return await roundRobinReassignment({ bookingId, orgId: ctx.user.organizationId });
};
export default roundRobinReassignHandler;