test: 为mapper补充测试
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m56s
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m56s
This commit is contained in:
@ -15,13 +15,17 @@ export function toSolutionListView(raw: Solution): SolutionListView {
|
||||
summary: '',
|
||||
};
|
||||
|
||||
const type = isObject<SolutionType>(raw.type)
|
||||
? raw.type.translations.length === 0
|
||||
? ''
|
||||
: raw.type.translations[0].name
|
||||
: '';
|
||||
|
||||
return {
|
||||
id: raw.id,
|
||||
title: trans.title,
|
||||
summary: trans.summary,
|
||||
solution_type: isObject<SolutionType>(raw.type)
|
||||
? raw.type.translations[0].name
|
||||
: '',
|
||||
solution_type: type,
|
||||
cover: isObject<DirectusFile>(raw.cover) ? raw.cover.id : raw.cover,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user