From 6fac2a495633c4691304b6bf732c126538393feb Mon Sep 17 00:00:00 2001 From: gofnnp Date: Tue, 7 Oct 2025 22:02:28 +0400 Subject: [PATCH] develop fix zod validation error --- src/entities/user/types.ts | 2 +- src/shared/api/httpClient.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/entities/user/types.ts b/src/entities/user/types.ts index b82174d..3c92dbd 100644 --- a/src/entities/user/types.ts +++ b/src/entities/user/types.ts @@ -39,7 +39,7 @@ const PartnerSchema = z export const UserSchema = z.object({ ipLookup: IpLookupSchema, - profile: ProfileSchema, + profile: ProfileSchema.optional(), partner: PartnerSchema, _id: z.string(), initialIp: z.string().optional(), diff --git a/src/shared/api/httpClient.ts b/src/shared/api/httpClient.ts index 2b69185..38dc0fd 100644 --- a/src/shared/api/httpClient.ts +++ b/src/shared/api/httpClient.ts @@ -160,7 +160,11 @@ class HttpClient { console.error(`📦 Raw Data:`, data); console.error(`📋 Schema Expected:`, schema._def); console.error(`⚠️ Validation Error:`, error); - console.error(`🔍 Data Type:`, typeof data, data === null ? "(null)" : ""); + console.error( + `🔍 Data Type:`, + typeof data, + data === null ? "(null)" : "" + ); throw error; } } else {