fix: make workflow page not static (#18925)
* fix: make workflow page not static * fix * fix
This commit is contained in:
1 parent
7fb60fe5f7
commit
ae51c8b599
2 files changed
+5
-11
No files matched your search
@@ -10,7 +10,6 @@ import Shell, { ShellMain } from "@calcom/features/shell/Shell";
|
||||
import { classNames } from "@calcom/lib";
|
||||
import { SENDER_ID } from "@calcom/lib/constants";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { useParamsWithFallback } from "@calcom/lib/hooks/useParamsWithFallback";
|
||||
import { HttpError } from "@calcom/lib/http-error";
|
||||
import type { WorkflowRepository } from "@calcom/lib/server/repository/workflow";
|
||||
import type { TimeUnit, WorkflowTriggerEvents } from "@calcom/prisma/enums";
|
||||
@@ -25,7 +24,7 @@ import LicenseRequired from "../../common/components/LicenseRequired";
|
||||
import SkeletonLoader from "../components/SkeletonLoaderEdit";
|
||||
import WorkflowDetailsPage from "../components/WorkflowDetailsPage";
|
||||
import { isSMSAction, isSMSOrWhatsappAction } from "../lib/actionHelperFunctions";
|
||||
import { formSchema, querySchema } from "../lib/schema";
|
||||
import { formSchema } from "../lib/schema";
|
||||
import { getTranslatedText, translateVariablesToEnglish } from "../lib/variableTranslations";
|
||||
|
||||
export type FormValues = {
|
||||
@@ -39,19 +38,20 @@ export type FormValues = {
|
||||
};
|
||||
|
||||
type PageProps = {
|
||||
workflow: number;
|
||||
workflowData?: Awaited<ReturnType<typeof WorkflowRepository.getById>>;
|
||||
verifiedNumbers?: Awaited<ReturnType<typeof WorkflowRepository.getVerifiedNumbers>>;
|
||||
verifiedEmails?: Awaited<ReturnType<typeof WorkflowRepository.getVerifiedEmails>>;
|
||||
};
|
||||
|
||||
function WorkflowPage({
|
||||
workflow: workflowId,
|
||||
workflowData: workflowDataProp,
|
||||
verifiedNumbers: verifiedNumbersProp,
|
||||
verifiedEmails: verifiedEmailsProp,
|
||||
}: PageProps) {
|
||||
const { t, i18n } = useLocale();
|
||||
const session = useSession();
|
||||
const params = useParamsWithFallback();
|
||||
|
||||
const [selectedOptions, setSelectedOptions] = useState<Option[]>([]);
|
||||
const [isAllDataLoaded, setIsAllDataLoaded] = useState(false);
|
||||
@@ -62,7 +62,6 @@ function WorkflowPage({
|
||||
resolver: zodResolver(formSchema),
|
||||
});
|
||||
|
||||
const { workflow: workflowId } = params ? querySchema.parse(params) : { workflow: -1 };
|
||||
const utils = trpc.useUtils();
|
||||
|
||||
const userQuery = useMeQuery();
|
||||
|
||||
Reference in new issue
Block a user