fix: 可选字段处理
- 为搜索条目中的可选字段进行判断并处理
This commit is contained in:
@ -12,6 +12,7 @@ describe('converters', () => {
|
||||
summary: 'High efficiency',
|
||||
description: 'Detailed description',
|
||||
type: 'pump',
|
||||
cover: 'rand-om__-uuid-1234',
|
||||
};
|
||||
const result = converters.products(item);
|
||||
expect(result).toEqual({
|
||||
@ -19,6 +20,7 @@ describe('converters', () => {
|
||||
type: 'product',
|
||||
title: 'Hydraulic Pump',
|
||||
summary: 'High efficiency',
|
||||
thumbnail: '/api/assets/rand-om__-uuid-1234',
|
||||
});
|
||||
});
|
||||
|
||||
@ -29,6 +31,7 @@ describe('converters', () => {
|
||||
summary: 'Effective solution',
|
||||
content: 'Detailed content',
|
||||
type: 'Type A',
|
||||
cover: 'rand-om__-uuid-5678',
|
||||
};
|
||||
const result = converters.solutions(item);
|
||||
expect(result).toEqual({
|
||||
@ -36,6 +39,7 @@ describe('converters', () => {
|
||||
type: 'solution',
|
||||
title: 'Solution A',
|
||||
summary: 'Effective solution',
|
||||
thumbnail: '/api/assets/rand-om__-uuid-5678',
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user