fix build errors

This commit is contained in:
Matthias Nannt
2024-10-24 15:52:05 +02:00
parent d646f82a4a
commit cd523daa73
5 changed files with 5 additions and 6 deletions

View File

@@ -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";

View File

@@ -42,6 +42,7 @@ export const updateAttribute = async (
const res = await api.client.attribute.update({ userId, attributes: { [key]: value } });
if (!res.ok) {
// @ts-expect-error
if (res.error.details?.ignore) {
logger.error(res.error.message ?? `Error updating person with userId ${userId}`);
return {
@@ -54,7 +55,7 @@ export const updateAttribute = async (
}
return err({
code: "network_error",
status: res.error.status ?? 500,
status: 500,
message: res.error.message ?? `Error updating person with userId ${userId}`,
url: `${config.get().apiHost}/api/v1/client/${environmentId}/people/${userId}/attributes`,
responseMessage: res.error.message,
@@ -121,6 +122,7 @@ export const updateAttributes = async (
if (res.ok) {
return ok(updatedAttributes);
} else {
// @ts-expect-error
if (res.error.details?.ignore) {
logger.error(res.error.message ?? `Error updating person with userId ${userId}`);
return ok(updatedAttributes);

View File

@@ -22,7 +22,7 @@ export const resetPerson = async (): Promise<Result<void, NetworkError>> => {
environmentId: config.get().environmentId,
apiHost: config.get().apiHost,
...(userId && { userId }),
attributes: config.get().personState.data.attributes,
attributes: config.get().attributes,
};
await logoutPerson();
try {

View File

@@ -15,7 +15,6 @@ export const DEFAULT_PERSON_STATE_NO_USER_ID: TJsPersonState = {
segments: [],
displays: [],
responses: [],
attributes: {},
lastDisplayAt: null,
},
} as const;
@@ -68,7 +67,6 @@ export const fetchPersonState = async (
segments: [],
displays: [],
responses: [],
attributes: {},
lastDisplayAt: null,
},
};

View File

@@ -65,7 +65,7 @@ const renderWidget = async (
}
const { product } = config.get().environmentState.data ?? {};
const { attributes } = config.get().personState.data ?? {};
const { attributes } = config.get() ?? {};
const isMultiLanguageSurvey = survey.languages.length > 1;
let languageCode = "default";