Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Schedule feature

default discord avatar
gabrielsantos69452 years ago
3

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?

  • discord user avatar
    seanzubrickas
    2 years ago

    Hey

    @931543970369126450

    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/567

    and will likely make its way to our roadmap!

  • discord user avatar
    jarrod_not_jared
    2 years ago
    @931543970369126450

    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

    and

    not 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 👍

  • discord user avatar
    seanzubrickas
    2 years ago

    Good call Jarrod!

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.