Local api and versioning (drafts) #12236
Unanswered
sviatoslav-hulko
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there! I'm currently working with Payload CMS for my admin panel, and I also have a REST API where I use Payload as an ORM to interact with the data created via the admin panel. I'm encountering a challenge where I need to retrieve only the published documents from a collection, but I have drafts enabled. After going through the docs and exploring some discussions in the community, I haven't been able to find a clear solution on how to filter only published documents.
One important aspect is that I'm using Payload's built-in authentication only for the admin panel, while in my API, I have a custom authentication system in place (alongside different collections for storing users). Given this setup, is there a way to configure Payload (either in the main config or at the collection level) to automatically retrieve only the published documents when querying from my API, without needing to manually filter out drafts every time?
Beta Was this translation helpful? Give feedback.
All reactions