Skip to content

Commit cc4ec4f

Browse files
committed
Improve commonbutton description
1 parent 62bec24 commit cc4ec4f

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

components/Products/ProductsSingleProduct.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
</p>
6767
<div class="pt-1 mt-2">
6868
<ProductsAddToCartButton :product="data.product" />
69+
70+
6971
</div>
7072
</div>
7173
</div>
@@ -76,6 +78,7 @@
7678

7779
<script setup>
7880
import 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
8083
import { stripHTML, filteredVariantPrice } from "@/utils/functions";
8184
@@ -87,5 +90,18 @@ const props = defineProps({
8790
});
8891
8992
const 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>

components/common/CommonButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
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
6262
defineEmits(["CommonButtonClick"]);

0 commit comments

Comments
 (0)