Override Publish changes button + Return all drafts #1237
-
Hey, I couldn't locate any info on this. Is there option to override Second question: Can I query DB for all draft documents? I saw preview function that can send whole draft to the frontend, but I would like users to be able to save like ~10 different drafts and sort of preview all of them. Is that possible? Third question: Is there a way to batch publish multiple documents together? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey @adam-mrozik — good question!
How's that? |
Beta Was this translation helpful? Give feedback.
-
Everything has changed since this thread was answered. I wanted to give an update.
First of all, there is the ability to swap out the For custom endpoints made with the same route and method as an existing Payload endpoint, your own handler will be called instead (or used like a middleware if you call next() from req, res, next). This is helpful if you are able to do your custom logic server side and also whatever you're adding is good for any rest calls to that endpoint (no way to distinguish a REST call from the admin UI apart from any other source). The custom endpoints are changing a bit for v3 since we won't be on express. You'll still be able to do your own custom endpoints, but I believe you'll have to call the underlying method using the local API after your own logic instead of calling next()
This is an possible now from the list view of a collection with drafts enabled by selecting multiple rows in the list, or all docs, or querying within the filters in the UI and selecting all that match. |
Beta Was this translation helpful? Give feedback.
Hey @adam-mrozik — good question!
Publish changes
button is currently not possible, but it would be a great addition. We would accept a PR to add this functionality for sure. It would just function like how swapping in a custom component works now - except you'd swap in your ownPublish
button. Would be cool. Can I ask what you're looking to do with this?where: { _status: { equals: 'draft' } }
. But that will not send back pages that have been published, but have newer drafts available. To get bo…