From 432f80f1a6876026e1bf27b98141e9e148e35aca Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 13 Jan 2025 11:59:30 +0100 Subject: [PATCH] Fix types --- packages/client/src/api/patches.ts | 2 +- packages/frontend-core/src/api/self.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/api/patches.ts b/packages/client/src/api/patches.ts index 8f09eb5442..9482644fa7 100644 --- a/packages/client/src/api/patches.ts +++ b/packages/client/src/api/patches.ts @@ -55,7 +55,7 @@ export const patchAPI = (API: APIClient) => { const fetchSelf = API.fetchSelf API.fetchSelf = async () => { const user = await fetchSelf() - if (user && user._id) { + if (user && "_id" in user && user._id) { if (user.roleId === "PUBLIC") { // Don't try to enrich a public user as it will 403 return user diff --git a/packages/frontend-core/src/api/self.ts b/packages/frontend-core/src/api/self.ts index db5b1226eb..0f4ff1f985 100644 --- a/packages/frontend-core/src/api/self.ts +++ b/packages/frontend-core/src/api/self.ts @@ -13,7 +13,7 @@ export interface SelfEndpoints { generateAPIKey: () => Promise fetchDeveloperInfo: () => Promise fetchBuilderSelf: () => Promise - fetchSelf: () => Promise + fetchSelf: () => Promise } export const buildSelfEndpoints = (API: BaseAPIClient): SelfEndpoints => ({