Добавлены новые поля в тип LaximoFulltextDetail и обновлен резолвер для маппинга данных, включая обработку отсутствующих полей. Это улучшает соответствие данных GraphQL схеме и обеспечивает более полное представление деталей.

This commit is contained in:
Bivekich
2025-06-30 00:46:45 +03:00
parent d565416b55
commit 3a160efd17
2 changed files with 33 additions and 0 deletions

View File

@ -1927,6 +1927,29 @@ export const resolvers = {
result.details.length
)
}
// Мапим данные для GraphQL схемы, добавляя отсутствующие поля
if (result) {
return {
...result,
details: result.details.map(detail => ({
detailid: null, // Полнотекстовый поиск не возвращает detailid
oem: detail.oem,
formattedoem: detail.oem, // Используем oem как formattedoem
name: detail.name,
brand: detail.brand || null,
description: detail.description || null,
codeonimage: null,
code: null,
note: null,
filter: null,
parttype: null,
price: null,
availability: null,
attributes: []
}))
}
}
return result
} catch (err) {

View File

@ -1473,10 +1473,20 @@ export const typeDefs = gql`
}
type LaximoFulltextDetail {
detailid: String
oem: String!
formattedoem: String
name: String!
brand: String
description: String
codeonimage: String
code: String
note: String
filter: String
parttype: String
price: String
availability: String
attributes: [LaximoDetailAttribute!]
}
# Типы для Doc FindOEM