fix: 修复前端类型标注与GraphQL访问数据不同的问题
- 将类型标注中的id字段改为string
This commit is contained in:
@ -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: '' }],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user