Refactoring Post Publication System
2023-12-07 09:00 WIB - Hendrik Lie
We have completely revamped our post publication system!
Basically we want to simplify how we publish a post (or when we want to unpublish it). We simplify the create and edit post form, where previously we have to select between yes or no with a radio button. In this new change, we can now just mark a checkbox.
Meanwhile in /posts/ and /posts/{uuid}
route, we can mark a post published or not with a single button. The
button will toggle between publish or unpublish, depending on whether
the post is already published or not.
Summary
The following changes are applied:
- Make
is_publishedselected via a checkbox instead of radio buttons - Make a button that uses route
/posts/{uuid}/publishto publish a post - Make a button that uses route
/posts/{uuid}/unpublishto unpublish a post - On forms, maybe consider using conditionals on whether showing publish or unpublish posts, but not both.