fix(ui): prevent edits and validate read-only metadata fields

This commit is contained in:
yiling
2026-05-27 23:08:10 +08:00
parent d4e681fcdc
commit fa53ffab02
5 changed files with 68 additions and 2 deletions
+7
View File
@@ -264,6 +264,13 @@ export class MetadataService {
await this.client.$transaction(async (tx) => {
for (const req of reqs) {
const field = await tx.metadataField.findUnique({
where: { key: req.key },
})
if (field?.readOnly) {
throw new Error(`Field ${field.key} is read-only`)
}
const value = req.value
let stringValue: string | null = null
let numberValue: number | null = null