We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ddfc95 commit a3160d9Copy full SHA for a3160d9
store/useCart.js
@@ -11,16 +11,6 @@ const state = {
11
export const useCart = defineStore("shopState", {
12
state: () => state,
13
actions: {
14
- async getProductsFromApi() {
15
- try {
16
- this.loading = true;
17
- const response = await axios.get("/api/products");
18
- this.products = response.data;
19
- this.loading = false;
20
- } catch (error) {
21
- this.error = error;
22
- }
23
- },
24
addToCart({ item }) {
25
const foundProductInCartIndex = this.cart.findIndex(
26
(cartItem) => item.slug === cartItem.slug
0 commit comments