fix: 修复前端类型标注与GraphQL访问数据不同的问题
- 将类型标注中的id字段改为string
This commit is contained in:
@ -24,7 +24,7 @@ export function toHomepageView(raw: Homepage): HomepageView {
|
||||
const cover = isObject<DirectusFile>(item.cover) ? item.cover.id : '';
|
||||
|
||||
return {
|
||||
id: item.id,
|
||||
id: item.id.toString(),
|
||||
name: trans?.name ?? '',
|
||||
summary: trans?.summary ?? '',
|
||||
cover: cover,
|
||||
@ -38,7 +38,7 @@ export function toHomepageView(raw: Homepage): HomepageView {
|
||||
const cover = isObject<DirectusFile>(item.cover) ? item.cover.id : '';
|
||||
|
||||
return {
|
||||
id: item.id,
|
||||
id: item.id.toString(),
|
||||
title: trans?.title ?? '',
|
||||
summary: trans?.summary ?? '',
|
||||
cover: cover,
|
||||
@ -46,7 +46,7 @@ export function toHomepageView(raw: Homepage): HomepageView {
|
||||
});
|
||||
|
||||
return {
|
||||
id: raw.id,
|
||||
id: raw.id.toString(),
|
||||
carousel: carousel ?? [],
|
||||
recommendProducts: products ?? [],
|
||||
recommendSolutions: solutions ?? [],
|
||||
|
||||
Reference in New Issue
Block a user