mirror of https://github.com/halo-dev/halo
refactor: theme list data conversion (#2592)
#### What type of PR is this? /kind bug /area core /milestone 2.0 #### What this PR does / why we need it: 修复主题列表数据类型转换问题 #### Which issue(s) this PR fixes: Fixes # #### Special notes for your reviewer: how to test it? 访问如下 API 不报错即可 ``` curl http://localhost:8090/apis/api.console.halo.run/v1alpha1/themes?uninstalled=false ``` /cc @halo-dev/sig-halo #### Does this PR introduce a user-facing change? ```release-note None ```pull/2593/head
parent
299634b756
commit
9d67ce60cc
|
@ -310,6 +310,7 @@ public class ThemeEndpoint implements CustomEndpoint {
|
|||
return walkThemesFromPath(themesDir)
|
||||
.filter(Files::isDirectory)
|
||||
.map(themePath -> loadUnstructured(themePath, THEME_MANIFESTS))
|
||||
.flatMap(Flux::fromIterable)
|
||||
.map(unstructured -> Unstructured.OBJECT_MAPPER.convertValue(unstructured,
|
||||
Theme.class))
|
||||
.sort(Comparator.comparing(theme -> theme.getMetadata().getName()));
|
||||
|
|
Loading…
Reference in New Issue