Skip to content

fix(nodes): normalize null tags to [] in node-form to prevent Invalid input error#52

Open
web-ppanel wants to merge 1 commit into
mainfrom
fix/node-form-empty-tags
Open

fix(nodes): normalize null tags to [] in node-form to prevent Invalid input error#52
web-ppanel wants to merge 1 commit into
mainfrom
fix/node-form-empty-tags

Conversation

@web-ppanel
Copy link
Copy Markdown
Contributor

Fixes #51

When a node was created without tags, the API returns tags: null. Editing such a node caused an "Invalid input" error because null failed z.array(z.string()) validation, blocking saves.

Fix:

  • Use z.preprocess to coerce null/undefined to [] in the zod schema
  • Add normalizeValues() helper to sanitize initialValues before form default/reset

… input error

When a node was created without tags (tags is null from API), editing
it caused an 'Invalid input' validation error because null failed
z.array(z.string()) validation.

- Use z.preprocess to coerce null/undefined to [] in zod schema
- Add normalizeValues() helper to ensure tags is always [] before
  spreading initialValues into form defaultValues and reset()

Closes #51
@netlify
Copy link
Copy Markdown

netlify Bot commented May 12, 2026

Deploy Preview for ppane-docs ready!

Name Link
🔨 Latest commit 33ad713
🔍 Latest deploy log https://app.netlify.com/projects/ppane-docs/deploys/6a02bfc7848c7d0008938936
😎 Deploy Preview https://deploy-preview-52--ppane-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants