Since the implementation of the ability to publish and unpublish posts, it is now essential to ensure that only published posts are displayed to users. This pull request addresses this requirement by adding a condition to the mapping function that renders the list of posts. This condition checks if each post is published before rendering it. If a post is unpublished, it will be excluded from the list.
Changes Made:
Added a condition to the mapping function that renders the list of posts.
The condition checks if each post is published (post.published) before rendering it.
If a post is unpublished (!post.published), it is excluded from the list.
Edit: I forgot to apply the logic for the topics page.
Description:
Since the implementation of the ability to publish and unpublish posts, it is now essential to ensure that only published posts are displayed to users. This pull request addresses this requirement by adding a condition to the mapping function that renders the list of posts. This condition checks if each post is published before rendering it. If a post is unpublished, it will be excluded from the list.
Changes Made:
post.published
) before rendering it.!post.published
), it is excluded from the list.Edit: I forgot to apply the logic for the topics page.