mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 18:30:32 -06:00
fix: remove person validation in syncSurveys for backwards compatibility (#1737)
This commit is contained in:
@@ -5,7 +5,7 @@ import { TActionClass } from "@formbricks/types/actionClasses";
|
||||
import { ZOptionalNumber } from "@formbricks/types/common";
|
||||
import { ZId } from "@formbricks/types/environment";
|
||||
import { DatabaseError, ResourceNotFoundError } from "@formbricks/types/errors";
|
||||
import { TPerson, ZPerson } from "@formbricks/types/people";
|
||||
import { TPerson } from "@formbricks/types/people";
|
||||
import { TSurvey, TSurveyAttributeFilter, TSurveyInput, ZSurvey } from "@formbricks/types/surveys";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { unstable_cache } from "next/cache";
|
||||
@@ -14,6 +14,7 @@ import { getAttributeClasses } from "../attributeClass/service";
|
||||
import { ITEMS_PER_PAGE, SERVICES_REVALIDATION_INTERVAL } from "../constants";
|
||||
import { displayCache } from "../display/cache";
|
||||
import { getDisplaysByPersonId } from "../display/service";
|
||||
import { personCache } from "../person/cache";
|
||||
import { productCache } from "../product/cache";
|
||||
import { getProductByEnvironmentId } from "../product/service";
|
||||
import { responseCache } from "../response/cache";
|
||||
@@ -22,7 +23,6 @@ import { diffInDays } from "../utils/datetime";
|
||||
import { validateInputs } from "../utils/validate";
|
||||
import { surveyCache } from "./cache";
|
||||
import { formatSurveyDateFields } from "./util";
|
||||
import { personCache } from "../person/cache";
|
||||
|
||||
export const selectSurvey = {
|
||||
id: true,
|
||||
@@ -608,7 +608,7 @@ export const duplicateSurvey = async (environmentId: string, surveyId: string) =
|
||||
};
|
||||
|
||||
export const getSyncSurveys = (environmentId: string, person: TPerson): Promise<TSurvey[]> => {
|
||||
validateInputs([environmentId, ZId], [person, ZPerson]);
|
||||
validateInputs([environmentId, ZId]);
|
||||
|
||||
return unstable_cache(
|
||||
async () => {
|
||||
|
||||
Reference in New Issue
Block a user