Hi Guys,
I've got a blog article page setup and I want to return articles of a related to the category that the current user is on, in async I have:
const post = (await $prismic.api.getByUID('post', params.uid)).data
const categoryPosts = await $prismic.api.query([
$prismic.predicates.at('document.type', 'post'),
$prismic.predicates.at('my.post.blog_category', 'XtemFBIAACQAN3am')
])
and the return
document: post,
slices: post.body,
related: categoryPosts.results,
categoryPosts is working with the blog_category ID XtemFBIAACQAN3am hardcoded, it will return all blog posts specifcally with the category ID, but I want it to return that ID based main documents selected category so that it would be dynamic.
bog_category is a relationship field set up on the post constrained to the custom type: category