generated from pascalmartineau/wp-skeleton
8 lines
387 B
TypeScript
8 lines
387 B
TypeScript
export async function useSiteOptions() {
|
|
const { data } = await useAsyncGraphqlQuery("siteOptions", {}, { graphqlCaching: { client: true } });
|
|
if (data.value?.errors?.length || !data.value?.data.siteOptions?.ccat) {
|
|
throw createError({ statusCode: 500, message: "Erreur lors de la récupération des options du site" });
|
|
}
|
|
return { ...data.value?.data.siteOptions?.ccat };
|
|
}
|