Skip to content

fix(announcement): remove incorrect pinned/popup false filters on announcement list page#54

Open
web-ppanel wants to merge 3 commits into
mainfrom
fix/announcement-list-filter
Open

fix(announcement): remove incorrect pinned/popup false filters on announcement list page#54
web-ppanel wants to merge 3 commits into
mainfrom
fix/announcement-list-filter

Conversation

@web-ppanel
Copy link
Copy Markdown
Contributor

Summary

The announcement list page (/announcement) was calling queryAnnouncement with pinned: 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

Rafa-Ross and others added 3 commits May 12, 2026 05:48
… 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
@netlify
Copy link
Copy Markdown

netlify Bot commented May 12, 2026

Deploy Preview for ppane-docs ready!

Name Link
🔨 Latest commit 7dac476
🔍 Latest deploy log https://app.netlify.com/projects/ppane-docs/deploys/6a02c335dac2bd0008abdd87
😎 Deploy Preview https://deploy-preview-54--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

Development

Successfully merging this pull request may close these issues.

[Bug] 后台设置的公告,前端不显示

2 participants