feat(website): 对齐官网文章配置与展示顺序
This commit is contained in:
@@ -168,15 +168,11 @@ export function validateField(key, rawValue) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// An empty article list is valid: the official list page shows its "内容筹备中" empty state.
|
||||
export function validateSettings(values) {
|
||||
return Object.fromEntries(
|
||||
[...new Set(TABS.flatMap((tab) => tab.fields))]
|
||||
.map((key) => [
|
||||
key,
|
||||
key === 'insights' && !values.insights?.articles?.length
|
||||
? '请完善动态与洞察的配置'
|
||||
: validateField(key, values[key]),
|
||||
])
|
||||
.map((key) => [key, validateField(key, values[key])])
|
||||
.filter(([, error]) => error),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user