How to Filter Features by Both Site and Locale in Payload CMS Without Mixing Content from Other Sites #8498
Unanswered
Derflex-primo
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
-
I'm working with Payload CMS and have run into an issue with filtering data based on both site and locale. Here's an overview of my setup:
Locales Collection:
Sites Collection:
Features Collection:
The Issue:
When I query features for site.b.com with a specific locale (es_ES), Payload CMS returns all features for that locale, regardless of which site the feature actually belongs to. This results in features from site.a.com (since site.a.com supports es_ES) being included in the response for site.b.com.
For example:
This is the query I’m using:
http://localhost:3000/api/features?where[sites.domain][equals]=site.b.com&where[sites.locales.locales][equals]=es_ES&depth=2
What I've Tried:
Question:
How can I adjust my query (or configuration) so that it correctly filters features by both the domain and locale associated with each site, preventing features from site.a.com from showing up in queries for site.b.com?
NOTE:
I'm not building a multi-tenant admin dashboard.
Each site has entirely different content, but they share a single repository.
Beta Was this translation helpful? Give feedback.
All reactions