fix: make workflow page not static (#18925)

* fix: make workflow page not static

* fix

* fix
This commit is contained in:
Benny Joo
2025-01-27 18:05:15 +00:00
committed by GitHub
parent 7fb60fe5f7
commit ae51c8b599
2 changed files with 5 additions and 11 deletions
@@ -37,8 +37,6 @@ export const generateMetadata = async ({ params }: PageProps): Promise<Metadata
);
};
export const generateStaticParams = () => [];
const Page = async ({ params }: PageProps) => {
// const session = await getServerSession({ req: buildLegacyRequest(headers(), cookies()) });
// const user = session?.user;
@@ -65,13 +63,10 @@ const Page = async ({ params }: PageProps) => {
return (
<LegacyPage
// workflowData={workflow} verifiedEmails={verifiedEmails} verifiedNumbers={verifiedNumbers}
workflow={parsed.data.workflow}
// workflowData={workflow} verifiedEmails={verifiedEmails} verifiedNumbers={verifiedNumbers}
/>
);
};
export default Page;
export const dynamic = "force-static";
// generate segments on demand
export const dynamicParams = true;
export const revalidate = 10;
@@ -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();