mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-05-06 13:48:55 +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:
@@ -72,6 +72,7 @@ const serverFormSchema = z.object({
|
|||||||
if (s.length === 0) return true
|
if (s.length === 0) return true
|
||||||
try {
|
try {
|
||||||
const obj = JSON.parse(s)
|
const obj = JSON.parse(s)
|
||||||
|
if (typeof obj !== "object" || obj === null) return true
|
||||||
return PublicNoteSchema.safeParse(obj).success
|
return PublicNoteSchema.safeParse(obj).success
|
||||||
} catch {
|
} catch {
|
||||||
// skip check if not JSON
|
// skip check if not JSON
|
||||||
|
|||||||
Reference in New Issue
Block a user