mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-18 06:52:01 -05:00
refactor: deduplicate link survey search params type
Co-authored-by: Johannes <jobenjada@users.noreply.github.com>
This commit is contained in:
@@ -19,17 +19,10 @@ import { SurveyCompletedMessage } from "@/modules/survey/link/components/survey-
|
||||
import { SurveyInactive } from "@/modules/survey/link/components/survey-inactive";
|
||||
import { VerifyEmail } from "@/modules/survey/link/components/verify-email";
|
||||
import { getEmailVerificationDetails } from "@/modules/survey/link/lib/helper";
|
||||
import type { TLinkSurveySearchParams } from "@/modules/survey/link/lib/types";
|
||||
import { hasUserIdSearchParam } from "@/modules/survey/link/lib/user-id";
|
||||
import { TWorkspaceContextForLinkSurvey } from "@/modules/survey/link/lib/workspace";
|
||||
|
||||
type TLinkSurveySearchParams = {
|
||||
verify?: string;
|
||||
lang?: string;
|
||||
embed?: string;
|
||||
preview?: string;
|
||||
suId?: string;
|
||||
} & Record<string, string | string[] | undefined>;
|
||||
|
||||
interface SurveyRendererProps {
|
||||
survey: TSurvey;
|
||||
searchParams: TLinkSurveySearchParams;
|
||||
|
||||
@@ -14,22 +14,15 @@ import {
|
||||
getMetadataBrandColor,
|
||||
getSurveyOpenGraphMetadata,
|
||||
} from "@/modules/survey/link/lib/metadata-utils";
|
||||
import type { TLinkSurveySearchParams } from "@/modules/survey/link/lib/types";
|
||||
import { getWorkspaceContextForLinkSurvey } from "@/modules/survey/link/lib/workspace";
|
||||
import { getWorkspaceById } from "@/modules/survey/link/lib/workspace";
|
||||
|
||||
type TContactSurveyPageSearchParams = {
|
||||
suId?: string;
|
||||
verify?: string;
|
||||
lang?: string;
|
||||
embed?: string;
|
||||
preview?: string;
|
||||
} & Record<string, string | string[] | undefined>;
|
||||
|
||||
interface ContactSurveyPageProps {
|
||||
params: Promise<{
|
||||
jwt: string;
|
||||
}>;
|
||||
searchParams: Promise<TContactSurveyPageSearchParams>;
|
||||
searchParams: Promise<TLinkSurveySearchParams>;
|
||||
}
|
||||
|
||||
export const generateMetadata = async (props: ContactSurveyPageProps): Promise<Metadata> => {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
export type TLinkSurveySearchParams = {
|
||||
suId?: string;
|
||||
verify?: string;
|
||||
lang?: string;
|
||||
embed?: string;
|
||||
preview?: string;
|
||||
} & Record<string, string | string[] | undefined>;
|
||||
@@ -9,22 +9,15 @@ import { SurveyInactive } from "@/modules/survey/link/components/survey-inactive
|
||||
import { renderSurvey } from "@/modules/survey/link/components/survey-renderer";
|
||||
import { getResponseBySingleUseId, getSurveyWithMetadata } from "@/modules/survey/link/lib/data";
|
||||
import { checkAndValidateSingleUseId } from "@/modules/survey/link/lib/helper";
|
||||
import type { TLinkSurveySearchParams } from "@/modules/survey/link/lib/types";
|
||||
import { getWorkspaceContextForLinkSurvey } from "@/modules/survey/link/lib/workspace";
|
||||
import { getMetadataForLinkSurvey } from "@/modules/survey/link/metadata";
|
||||
|
||||
type TLinkSurveyPageSearchParams = {
|
||||
suId?: string;
|
||||
verify?: string;
|
||||
lang?: string;
|
||||
embed?: string;
|
||||
preview?: string;
|
||||
} & Record<string, string | string[] | undefined>;
|
||||
|
||||
interface LinkSurveyPageProps {
|
||||
params: Promise<{
|
||||
surveyId: string;
|
||||
}>;
|
||||
searchParams: Promise<TLinkSurveyPageSearchParams>;
|
||||
searchParams: Promise<TLinkSurveySearchParams>;
|
||||
}
|
||||
|
||||
export const generateMetadata = async (props: LinkSurveyPageProps): Promise<Metadata> => {
|
||||
|
||||
Reference in New Issue
Block a user