mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-11-04 08:50:20 +00:00
fix: public_note validation rejects non-object JSON values, preventing second edit (#154)
Co-authored-by: naiba <naiba@users.noreply.github.com>
This commit is contained in:
1 parent
2fe19adb96
commit
d04c4a1784
1 file changed
+1
@@ -72,6 +72,7 @@ const serverFormSchema = z.object({
|
||||
if (s.length === 0) return true
|
||||
try {
|
||||
const obj = JSON.parse(s)
|
||||
if (typeof obj !== "object" || obj === null) return true
|
||||
return PublicNoteSchema.safeParse(obj).success
|
||||
} catch {
|
||||
// skip check if not JSON
|
||||
|
||||
Reference in new issue
Block a user