How to post data to Prismic as a draft

Hi,

I am wanting to build a frontend form that will allow users to complete a set of form fields and submit the data to a Prismic contentType, creating a new entry, but as a draft by default. That way an admin can log in and approve the entry by publishing to the frontend.

How would it be best to go about this using the API?

Thanks in advance :handshake:

Hi Luke,

This use case is not specifically covered by Prismic yet. Ideally, comments or feedback would be contained in the hierarchy of the document they are attached to instead of being created as individual documents, as it may become difficult for content marketers to manage large amounts of comments as individual documents in Prismic.

Also note that Prismic isn't meant to store personal or sensitive data, in case form submissions would include that.

The Migration API allows creation of documents in a special type of release called the Migration Release, which then can be previewed and published in bulk the UI, but this API was designed for two specific use cases: moving existing content to Prismic and bulk updating content.

Our recommendation is therefore to follow the implementation we used to integrate comments for our Prismic blog, as described in this tutorial:

I hope this helps :slight_smile:

Thanks for that @Phil ,

The idea behind this wasn't to store personal/sensitive data, but for a feature being being planned for a jobs board project.

An authenticated user could fill out a form to post a job. Jobs will be created and displayed as a reusable contentType so rather than the form emailing the content to the customer who would then manually setup the job entry in the CMS, the data from the form would be used to create the entry. The draft element was to allow a final manual layer before it was made live.

Based on this info, is the migration API or the Supabase route still the only cause of action?

Thanks

1 Like

Yes, and for me SupaBase sounds like your best option.

@Phil so with this approach, SupaBase would be where all job role entries would be stored and then fetched and displayed on the website? We wouldn't really need to use Prismic for this?

Correct.