fix: Add troubleshooting data and ensure no errors in live mode of router. (#17188)

This commit is contained in:
Hariom Balhara authored and GitHub committed 2024-10-19 07:22:04 -07:00
1 parent 474f81f08e
commit 731f97ebe4
8 files changed
+432 -86

No files matched your search

+3 -4
View File
@@ -27,7 +27,6 @@ import type { Ensure } from "@calcom/types/utils";
import { Dialog, DialogContent, DialogFooter, DialogHeader } from "@calcom/ui";
import { Button, Tooltip } from "@calcom/ui";
import { showToast } from "@calcom/ui/components/toast";
import useRouterQuery from "@calcom/web/lib/hooks/useRouterQuery";
const enum ReroutingStatusEnum {
REROUTING_NOT_INITIATED = "not_initiated",
@@ -599,9 +598,9 @@ const NewRoutingManager = ({
}
function reroutingCTAs() {
if(chosenRoute.action.type !== RouteActionType.EventTypeRedirectUrl) {
if (chosenRoute.action.type !== RouteActionType.EventTypeRedirectUrl) {
// There are no actions to perform if the new chosen route isn't an event type redirect
return null
return null;
}
const shouldDisableCTAs = teamMembersMatchingAttributeLogic.isPending || createBookingMutation.isPending;
return (
@@ -766,7 +765,7 @@ const RerouteDialogContentAndFooterWithFormResponse = ({
const findTeamMembersMatchingAttributeLogicMutation =
trpc.viewer.appRoutingForms.findTeamMembersMatchingAttributeLogic.useMutation({
onSuccess(data) {
setTeamMembersMatchingAttributeLogic(data);
setTeamMembersMatchingAttributeLogic(data.result);
},
});
@@ -168,13 +168,15 @@ vi.mock("@calcom/trpc/react", () => ({
useMutation: vi.fn(({ onSuccess }) => {
return {
mutate: vi.fn(() => {
onSuccess([
{
id: 1,
name: "Matching User 1",
email: "matching-user[email protected]",
},
]);
onSuccess({
result: [
{
id: 1,
name: "Matching User 1",
email: "[email protected]",
},
],
});
}),
};
}),