mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 10:19:51 -06:00
fix build errors
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user