chore: remove attributes from identify call (#4012)

Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com>
This commit is contained in:
Matti Nannt
2024-10-24 19:16:56 +02:00
committed by GitHub
parent 0d11c08be7
commit 5daeab6554
7 changed files with 34 additions and 78 deletions
@@ -1,6 +1,5 @@
import { prisma } from "@formbricks/database";
import { attributeCache } from "@formbricks/lib/attribute/cache";
import { getAttributesByUserId } from "@formbricks/lib/attribute/service";
import { cache } from "@formbricks/lib/cache";
import { IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants";
import { displayCache } from "@formbricks/lib/display/cache";
@@ -71,7 +70,6 @@ export const getPersonState = async ({
const personResponses = await getResponsesByUserId(environmentId, userId);
const personDisplays = await getDisplaysByUserId(environmentId, userId);
const segments = await getPersonSegmentIds(environmentId, person, device);
const attributes = await getAttributesByUserId(environmentId, userId);
// If the person exists, return the persons's state
const userState: TJsPersonState["data"] = {
@@ -81,7 +79,6 @@ export const getPersonState = async ({
personDisplays?.map((display) => ({ surveyId: display.surveyId, createdAt: display.createdAt })) ??
[],
responses: personResponses?.map((response) => response.surveyId) ?? [],
attributes,
lastDisplayAt:
personDisplays.length > 0
? personDisplays.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime())[0].createdAt