Skip to content

Commit

Permalink
fix(core): update query to check expiry date
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobonamin committed Sep 17, 2024
1 parent 2c90316 commit 4d9378f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/sanity/src/core/studio/studioAnnouncements/query.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
/**
* TODO: Remove once the API call is implemented
*/
export const studioAnnouncementQuery = `*[_type == "productAnnouncement"] | order(publishedDate desc) {
export const studioAnnouncementQuery = `*[_type == "productAnnouncement" &&
(
!defined(expiryDate) ||
defined(expiryDate) && dateTime(expiryDate) > dateTime(now())
)]
| order(publishedDate desc) {
...,
body[]{
...,
Expand Down

0 comments on commit 4d9378f

Please sign in to comment.