Hello
I have a content-type with a group field who contains text and boolean fields. In my filter query i want only fields who are set to true.
Content-type ID: header
Group field ID : share_social_media
Boolean field ID : display_social_network
Code :
import type {PrismicPlugin} from "@prismicio/vue";
import type {HeaderDocument, PrismicDocumentWithoutUID} from "@prismicio/types";
export const useSocialShareMedia = () => {
const prismic: PrismicPlugin = usePrismic();
return useAsyncData(
'$shareSocialMedia',
async (): Promise<PrismicDocumentWithoutUID> => await prismic.client.getSingle<HeaderDocument>('header', {
lang: 'fr-fr',
fetch: 'my.header.share_social_media',
filters: [
prismic.filter.at('my.header.share_social_media.display_social_network', true),
]
})
).data.value?.data.share_social_media;
But however i set true or false in back-office, all fields are displayed. So is my filter query wrong or i have to filter the response ?
Thank you.