Skip to content

Feature request: accommodations for event hooks #1455

@spiffytech

Description

@spiffytech

I'm trying to add some automation & verification to my workflow. Some examples:

  • When a post is set to 'published', automatically set the 'published_at' field to the current time
  • A post may only be published if required fields are filled in
  • When a post is created, store a random nonce so I can pass around unpublished drafts with secret URLs
  • Disallow saving a post if it's already published and the slug would change
  • Alternatively, create a redirect if I change a post slug

I don't know what Keystatic plans for the long term, but I think right now I could do all of this with just a few small changes:

  1. Commit to the /update route being a stable API so I can build a middleware that intercepts it
  2. Include the collection name and slug as fields in the POST body to /update
  3. Allow the server to signal that the client needs to reload the post content. Maybe a header?
  4. Have the UI gracefully handle if the server returns an HTTP error status & error message when saving.

With these changes, my server can intercept post updates and change the content however it needs. Looking at the existing network traffic, this feels fairly non-intrusive, but offers big benefits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions