generated from pascalmartineau/wp-skeleton
feat: Initial Nuxt app
This commit is contained in:
7
wp-content/themes/ccat/app/composables/useSiteOptions.ts
Normal file
7
wp-content/themes/ccat/app/composables/useSiteOptions.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
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 };
|
||||
}
|
||||
Reference in New Issue
Block a user