fix: 修复前端类型标注与GraphQL访问数据不同的问题

- 将类型标注中的id字段改为string
This commit is contained in:
2025-11-15 16:33:30 +08:00
parent 6f08701847
commit 496548afa4
27 changed files with 92 additions and 92 deletions

View File

@ -50,17 +50,17 @@ describe('toHomepageView', () => {
};
expect(toHomepageView(rawData)).toEqual({
id: 1,
id: '1',
carousel: ['file-uuid-1', 'file-uuid-2'],
recommendProducts: [
{
id: 1,
id: '1',
name: 'Product 1',
summary: 'Summary 1',
cover: 'cover-file-uuid-1',
},
{
id: 2,
id: '2',
name: 'Product 2',
summary: 'Summary 2',
cover: 'cover-file-uuid-2',
@ -68,7 +68,7 @@ describe('toHomepageView', () => {
],
recommendSolutions: [
{
id: 1,
id: '1',
title: 'Solution 1',
summary: 'Summary 1',
cover: 'cover-file-uuid-1',
@ -86,10 +86,10 @@ describe('toHomepageView', () => {
};
expect(toHomepageView(rawData)).toEqual({
id: 1,
id: '1',
carousel: [],
recommendProducts: [{ id: 1, name: '', summary: '', cover: '' }],
recommendSolutions: [{ id: 1, title: '', summary: '', cover: '' }],
recommendProducts: [{ id: '1', name: '', summary: '', cover: '' }],
recommendSolutions: [{ id: '1', title: '', summary: '', cover: '' }],
});
});
});