fix(config): silently skip readonly fields on save instead of rejecting

Frontend sends entire form state including readonly fields (PORT,
WEBHOOK_SECRET, JWT_SECRET). Previously the backend rejected the whole
request. Now readonly fields are silently skipped.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
jeffusion
2026-03-04 17:29:28 +08:00
committed by 路遥知码力
parent 3f2817d6c3
commit 12425d147f

View File

@@ -231,9 +231,8 @@ configRouter.put('/', async (c) => {
errors.push(`未知配置项: ${key}`);
continue;
}
// Reject readonly fields
// Silently skip readonly fields — frontend sends entire form state
if (field.readonly) {
errors.push(`${field.label}${key})为只读配置,无法通过 GUI 修改`);
continue;
}