Skip to content

Commit 271cf03

Browse files
committed
Update products.vue
1 parent 0ae2959 commit 271cf03

File tree

1 file changed

+1
-31
lines changed

1 file changed

+1
-31
lines changed

pages/products.vue

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,8 @@
11
<template>
2-
<div class="container mx-auto">
3-
<div class="flex flex-wrap">
4-
Hei!
5-
<ProductsShowAll />
6-
Filter:
7-
<ProductFilter />
8-
<div class="w-full md:w-3/4 p-4">
9-
<template v-if="pending">
10-
<SpinnerLoading />
11-
</template>
12-
<template v-else-if="error">
13-
<p>Error loading products.</p>
14-
</template>
15-
<template v-else>
16-
<ProductGrid :products="store.filteredProducts" />
17-
</template>
18-
</div>
19-
</div>
20-
</div>
2+
<ProductsShowAll />
213
</template>
224

235
<script setup>
24-
import { useProductsStore } from "@/store/useProductsStore";
25-
import FETCH_ALL_PRODUCTS_QUERY from "@/apollo/queries/FETCH_ALL_PRODUCTS_QUERY.gql";
26-
27-
const store = useProductsStore();
28-
29-
const { data, pending, error } = await useAsyncQuery(FETCH_ALL_PRODUCTS_QUERY);
30-
31-
if (data.value) {
32-
store.products = data.value.products.nodes;
33-
store.productTypes = store.getUniqueProductTypes;
34-
}
35-
366
useHead({
377
title: "Products",
388
titleTemplate: "%s - Nuxt 3 Woocommerce",

0 commit comments

Comments
 (0)