fix: unable to save legacy surveys (#2280)

This commit is contained in:
Matti Nannt
2024-03-19 10:06:18 +01:00
committed by GitHub
parent 63708ec92b
commit 6c84850a7e
4 changed files with 4 additions and 4 deletions

View File

@@ -53,7 +53,7 @@ export type TUserObjective = z.infer<typeof ZUserObjective>;
export const ZSurveyWelcomeCard = z.object({
enabled: z.boolean(),
headline: z.optional(z.string()),
headline: z.string().optional(),
html: z.string().optional(),
fileUrl: z.string().optional(),
buttonLabel: z.string().optional(),

View File

@@ -4,7 +4,7 @@ import { env } from "./env";
export const IS_FORMBRICKS_CLOUD = env.IS_FORMBRICKS_CLOUD === "1";
export const REVALIDATION_INTERVAL = 0; //TODO: find a good way to cache and revalidate data when it changes
export const SERVICES_REVALIDATION_INTERVAL = 60 * 30; // 30 minutes
export const SERVICES_REVALIDATION_INTERVAL = 60 * 60 * 3; // 3 hours
export const MAU_LIMIT = IS_FORMBRICKS_CLOUD ? 9000 : 1000000;
// URLs

View File

@@ -10,7 +10,7 @@ export const validateInputs = (...pairs: ValidationPair[]): void => {
if (!inputValidation.success) {
console.error(
`Validation failed for ${value} and ${JSON.stringify(schema)}: ${inputValidation.error.message}`
`Validation failed for ${JSON.stringify(value, null, 2)} and ${JSON.stringify(schema)}: ${inputValidation.error.message}`
);
throw new ValidationError("Validation failed");
}

View File

@@ -35,7 +35,7 @@ export enum TSurveyQuestionType {
export const ZSurveyWelcomeCard = z.object({
enabled: z.boolean(),
headline: ZI18nString,
headline: ZI18nString.optional(),
html: ZI18nString.optional(),
fileUrl: z.string().optional(),
buttonLabel: ZI18nString.optional(),