Skip to content

Commit df227dc

Browse files
committed
removed unnecessary logs
1 parent 5045478 commit df227dc

4 files changed

Lines changed: 8 additions & 12 deletions

File tree

app/_zustand/wishlistStore.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ export const useWishlistStore = create<State & Actions>((set) => ({
4040
});
4141
},
4242
setWishlist: (wishlist: ProductInWishlist[]) => {
43-
set((state) => {
44-
console.log("WStore");
45-
console.log(wishlist);
46-
47-
43+
set((state) => {
4844
return { wishlist: [...wishlist], wishQuantity: wishlist.length };
4945
});
5046
},

components/AddToWishlistBtn.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ const AddToWishlistBtn = ({ product, slug }: AddToWishlistBtnProps) => {
9999
})
100100
.then((response) => response.json())
101101
.then((data) => {
102-
console.log(data);
103-
104102
if (data[0]?.id) {
105103
setIsProductInWishlist(() => true);
106104
} else {

components/Header.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ const Header = () => {
5656
// getting user by email so I can get his user id
5757
const getUserByEmail = async () => {
5858
if (session?.user?.email) {
59-
console.log("called");
6059

6160
fetch(`http://localhost:3001/api/users/email/${session?.user?.email}`, {
6261
cache: "no-store",

components/Products.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,27 @@ import React from "react";
1212
import ProductItem from "./ProductItem";
1313

1414
const Products = async ({ slug }: any) => {
15-
// getting all data from URL slug and after that sending API request with filtering, sorting and pagination for getting all products
15+
// getting all data from URL slug and preparing everything for sending GET request
1616
const inStockNum = slug?.searchParams?.inStock === "true" ? 1 : 0;
1717
const outOfStockNum = slug?.searchParams?.outOfStock === "true" ? 1 : 0;
1818
const page = slug?.searchParams?.page ? Number(slug?.searchParams?.page) : 1;
1919

2020
let stockMode: string = "lte";
21-
21+
22+
// preparing inStock and out of stock filter for GET request
23+
// If in stock checkbox is checked, stockMode is "equals"
2224
if (inStockNum === 1) {
2325
stockMode = "equals";
2426
}
25-
27+
// If out of stock checkbox is checked, stockMode is "lt"
2628
if (outOfStockNum === 1) {
2729
stockMode = "lt";
2830
}
31+
// If in stock and out of stock checkboxes are checked, stockMode is "lte"
2932
if (inStockNum === 1 && outOfStockNum === 1) {
3033
stockMode = "lte";
3134
}
32-
35+
// If in stock and out of stock checkboxes aren't checked, stockMode is "gt"
3336
if (inStockNum === 0 && outOfStockNum === 0) {
3437
stockMode = "gt";
3538
}

0 commit comments

Comments
 (0)