Allow non-admin team members also to reroute (#17234)

This commit is contained in:
Hariom Balhara authored and GitHub committed 2024-10-22 13:46:30 +05:30
1 parent 2f4dd328c3
commit 86af6bd626
4 files changed
+35 -11

No files matched your search

+7 -3
View File
@@ -696,13 +696,13 @@ const RerouteDialogContentAndFooter = ({
}: Pick<RerouteDialogProps, "isOpenDialog" | "setIsOpenDialog"> & {
booking: TeamEventTypeBookingToReroute;
}) => {
const { data: responseWithForm, isPending: isRoutingFormLoading } =
const { data: responseWithForm, isPending: isRoutingFormLoading, error: formResponseFetchError } =
trpc.viewer.appRoutingForms.getResponseWithFormFields.useQuery({
formResponseId: booking.routedFromRoutingFormReponse.id,
});
const { t } = useLocale();
// useUpdateIsReroutingQueryParam({ isOpenDialog });
if (isRoutingFormLoading)
return (
<>
@@ -718,7 +718,11 @@ const RerouteDialogContentAndFooter = ({
</>
);
if (!responseWithForm) return <div>{t("something_went_wrong")}</div>;
if (formResponseFetchError) {
return <div className="mb-8">{formResponseFetchError.message}</div>;
}
if (!responseWithForm) return <div className="mb-8">{t("something_went_wrong")}</div>;
return (
<RerouteDialogContentAndFooterWithFormResponse