fix: 修正搜索页面文档路由跳转逻辑
- 点击文档条目时,跳转到对应的download路由 - 修改搜索条目转换逻辑,将product_documents类型条目的id有product_document的id改为文件uuid
This commit is contained in:
@ -63,10 +63,11 @@ describe('converters', () => {
|
||||
title: 'User Manual',
|
||||
products: ['Product A'],
|
||||
product_types: ['Type A'],
|
||||
fileUUID: 'TEST-UUID',
|
||||
};
|
||||
const result = converters.product_documents(item);
|
||||
expect(result).toEqual({
|
||||
id: 1,
|
||||
id: 'TEST-UUID',
|
||||
title: 'User Manual',
|
||||
summary: undefined,
|
||||
type: 'document',
|
||||
|
||||
@ -28,7 +28,7 @@ export const converters: {
|
||||
product_documents: (
|
||||
item: MeiliIndexMap['product_documents']
|
||||
): SearchItemView => ({
|
||||
id: item.id,
|
||||
id: item.fileUUID || item.id,
|
||||
type: 'document',
|
||||
title: item.title,
|
||||
}),
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
export interface SearchItemView {
|
||||
/** 唯一标识符 **/
|
||||
id: number;
|
||||
id: number | string;
|
||||
|
||||
/** 条目类型 **/
|
||||
type: 'product' | 'solution' | 'question' | 'document';
|
||||
|
||||
Reference in New Issue
Block a user