Hello there.
We're proposing PayloadCMS to a customer, and I'm in charge of make some PoCs based on their scenarios I'm stuck in one of these that is to make schedule system to scheduling posts changing its status publish and unpublished given a date.
Is there a solution for this case?
Is Payload provides any features like a CLI or hooks to do this?
Hey @gabrielsantos while we've built similar functionality in the past, we don't have anything off-the-shelf (yet) for Payload. It has been discussed here -
https://github.com/payloadcms/payload/discussions/567and will likely make its way to our roadmap!
@gabrielsantos you could possibly get away with using a date field, and a beforeRead hook that checks the date on the publishAt date field, if less than now
andnot published, publish the doc - after the update return the updated doc in your hook. If the post is already published you could skip that step and return the doc arg given to you in the beforeRead hook.
This might help get you to a working solution 👍
Good call Jarrod!
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.