fix(announcement): remove incorrect pinned/popup false filters on announcement list page#54
Open
web-ppanel wants to merge 3 commits into
Open
fix(announcement): remove incorrect pinned/popup false filters on announcement list page#54web-ppanel wants to merge 3 commits into
web-ppanel wants to merge 3 commits into
Conversation
… 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
When the Edit button is clicked, form.reset() was called with no
arguments, clearing all fields to default values. Because initialValues
(the row object) didn't change, the useEffect that repopulates the form
never re-fired, leaving the form blank. Saving then triggered Zod
validation errors ('Invalid input') since required fields were empty.
Fix: pass the normalized initialValues into form.reset() on the trigger
onClick, so the edit sheet always opens pre-filled with the current
node's data.
Closes #51
…ouncement list page The announcement list page was querying with pinned:false and popup:false, which excluded any announcements the admin marked as pinned or popup. Remove those filters so all announcements appear in the list. Fixes #49
✅ Deploy Preview for ppane-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The announcement list page (
/announcement) was callingqueryAnnouncementwithpinned: false, popup: false, which filtered out any announcement that the admin had marked as pinned or popup — effectively hiding all properly configured announcements.This removes those incorrect filters so all published announcements appear in the list.
Fixes #49