πŸ‘€ See Sanity in action: Watch product demo now β†’

Does anybody know how to validate the document before allowing publication?

3 replies
Last updated: Sep 24, 2020
Hi!I am using a document workflow based on
https://github.com/sanity-io/demo-custom-workflow .In this the publish action defined in publish.js, publishes via the following line:

ops.publish.execute()
But it seems that this publishes without validating the document at hand.

Does anybody know how to validate the document before allowing publication?
Sep 24, 2020, 8:08 AM
there's also a validation hook iirc
Sep 24, 2020, 9:35 AM
Perfect, just what I was looking for - thanks!
Sep 24, 2020, 9:36 AM

Sanity.io – build remarkable experiences at scale

Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Categorized in