From fd78900ac54b578a0fd78ef25e9e6b370baad226 Mon Sep 17 00:00:00 2001 From: Bivekich Date: Wed, 2 Jul 2025 16:56:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B5=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=B2=20=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D1=84?= =?UTF-8?q?=D0=B5=D0=B9=D1=81=20LaximoVehicleSearchResult=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D1=80=D0=B0=D1=81=D1=88=D0=B8=D1=80=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=BE=D0=BD=D0=B0?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D0=BE=D1=81=D1=82=D0=B8=20=D0=BF=D0=BE=D0=B8?= =?UTF-8?q?=D1=81=D0=BA=D0=B0=20=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=BE=D0=B1?= =?UTF-8?q?=D0=B8=D0=BB=D0=B5=D0=B9.=20=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=20=D1=80=D0=B5=D0=B7=D0=BE=D0=BB=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=20=D0=B4=D0=BB=D1=8F=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1?= =?UTF-8?q?=D0=BE=D1=82=D0=BA=D0=B8=20=D0=BD=D0=B5=D0=B0=D0=B2=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5?= =?UTF-8?q?=D0=BB=D0=B5=D0=B9,=20=D0=B2=D0=BE=D0=B7=D0=B2=D1=80=D0=B0?= =?UTF-8?q?=D1=89=D0=B0=D1=8F=20=D0=BF=D1=83=D1=81=D1=82=D0=BE=D0=B9=20?= =?UTF-8?q?=D0=BC=D0=B0=D1=81=D1=81=D0=B8=D0=B2=20=D0=B2=D0=BC=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=BE=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8.=20=D0=AD?= =?UTF-8?q?=D1=82=D0=BE=20=D1=83=D0=BB=D1=83=D1=87=D1=88=D0=B0=D0=B5=D1=82?= =?UTF-8?q?=20=D0=B2=D0=B7=D0=B0=D0=B8=D0=BC=D0=BE=D0=B4=D0=B5=D0=B9=D1=81?= =?UTF-8?q?=D1=82=D0=B2=D0=B8=D0=B5=20=D1=81=20API=20=D0=B8=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C?= =?UTF-8?q?=D1=81=D0=BA=D0=B8=D0=B9=20=D0=BE=D0=BF=D1=8B=D1=82.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/graphql/resolvers.ts | 3 ++- src/lib/laximo-service.ts | 26 +++++++++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/lib/graphql/resolvers.ts b/src/lib/graphql/resolvers.ts index 73186da..6edb0a8 100644 --- a/src/lib/graphql/resolvers.ts +++ b/src/lib/graphql/resolvers.ts @@ -1152,7 +1152,8 @@ export const resolvers = { try { const actualContext = context || getContext() if (!actualContext.clientId) { - throw new Error('Клиент не авторизован') + // Для неавторизованных пользователей возвращаем пустой массив + return [] } // Удаляем префикс client_ если он есть diff --git a/src/lib/laximo-service.ts b/src/lib/laximo-service.ts index 397cdc4..5234c00 100644 --- a/src/lib/laximo-service.ts +++ b/src/lib/laximo-service.ts @@ -86,6 +86,25 @@ export interface LaximoVehicleSearchResult { engine: string notes?: string ssd?: string + transmission?: string + date?: string + manufactured?: string + framecolor?: string + trimcolor?: string + engine_info?: string + engineno?: string + market?: string + prodRange?: string + prodPeriod?: string + destinationregion?: string + creationregion?: string + datefrom?: string + dateto?: string + modelyearfrom?: string + modelyearto?: string + options?: string + description?: string + grade?: string } export interface LaximoVehicleInfo { @@ -1699,7 +1718,6 @@ class LaximoService { // Дополнительные атрибуты из документации Laximo grade: attributeMap.get('grade') || undefined, transmission: attributeMap.get('transmission') || undefined, - doors: attributeMap.get('doors') || undefined, creationregion: attributeMap.get('creationregion') || undefined, destinationregion: attributeMap.get('destinationregion') || undefined, date: attributeMap.get('date') || undefined, @@ -1708,12 +1726,6 @@ class LaximoService { trimcolor: attributeMap.get('trimcolor') || undefined, datefrom: attributeMap.get('datefrom') || undefined, dateto: attributeMap.get('dateto') || undefined, - frame: attributeMap.get('frame') || undefined, - frames: attributeMap.get('frames') || undefined, - framefrom: attributeMap.get('framefrom') || undefined, - frameto: attributeMap.get('frameto') || undefined, - engine1: attributeMap.get('engine1') || undefined, - engine2: attributeMap.get('engine2') || undefined, engine_info: attributeMap.get('engine_info') || undefined, engineno: attributeMap.get('engineno') || undefined, options: attributeMap.get('options') || undefined,