I have a sidebar containing product categories and a grid of products. When the user selects a particular category, I need to load all of the products in that category.
In my Prismic repository, I have
Product contains a repeatable group of content relationships which link to one or more categories (i.e. 'Featured' and 'Travel'). These categories have a UID (i.e. 'featured') I am therefore trying to query based on this repeatable group as such:
const products = await this.$prismic.api.query( this.$prismic.predicates.at("my.product.categories.category", category.id) // category.id = 'featured' ) console.log(products.results)
This seems to run without any errors, however
products.results always contains 0 items.
Is there something I'm doing wrong here? Should it be possible to use this strategy, or is there a better way?
For reference, I'm using Nuxt.js.