File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 6666 </p >
6767 <div class =" pt-1 mt-2" >
6868 <ProductsAddToCartButton :product =" data.product" />
69+
70+
6971 </div >
7072 </div >
7173 </div >
7678
7779<script setup>
7880import GET_SINGLE_PRODUCT_QUERY from " @/apollo/queries/GET_SINGLE_PRODUCT_QUERY.gql" ;
81+ import ADD_TO_CART_MUTATION from " @/apollo/mutations/ADD_TO_CART_MUTATION.gql" ;
7982
8083import { stripHTML , filteredVariantPrice } from " @/utils/functions" ;
8184
@@ -87,5 +90,18 @@ const props = defineProps({
8790});
8891
8992const variables = { id: props .id , slug: props .slug };
90- const { data } = await useAsyncQuery (GET_SINGLE_PRODUCT_QUERY , variables);
93+ // const { data } = await useAsyncQuery(GET_SINGLE_PRODUCT_QUERY, variables);
94+ const { data } = await useQuery (GET_SINGLE_PRODUCT_QUERY , variables);
95+
96+ /* const addProductToCart = () => {
97+ console.log("Data: ", data.product)
98+ const productId = data.product.databaseId
99+ ? data.product.databaseId
100+ : data.product;
101+ const productQueryInput = {
102+ productId,
103+ };
104+
105+ };
106+ */
91107 </script >
Original file line number Diff line number Diff line change 5656<script setup>
5757/*
5858 * Usage:
59- * <CommonButton @common-button-click="functionName" isLoading ="true">Common button</CommonButton>
59+ * <CommonButton @common-button-click="functionName" is-loading ="true" link-to="/link ">Common button</CommonButton>
6060 */
6161
6262defineEmits ([" CommonButtonClick" ]);
You can’t perform that action at this time.
0 commit comments