remove some logs

This commit is contained in:
hamid zarghami
2025-11-06 10:04:45 +03:30
parent 8df0024f88
commit e50206bca4
5 changed files with 3 additions and 27 deletions
+2 -7
View File
@@ -10,13 +10,8 @@ export const getBlogs = async (
};
export const getBlogCategories = async (): Promise<BlogCategory[]> => {
try {
const { data } = await axios.get("/blogs/categories");
return data.results?.categories || [];
} catch (error) {
console.error("Error fetching blog categories:", error);
return [];
}
const { data } = await axios.get("/blogs/categories");
return data.results?.categories || [];
};
export const getBlogDetails = async (
+1 -5
View File
@@ -29,11 +29,7 @@ const CartShipping: NextPage = () => {
useEffect(() => {
const savedShipments = localStorage.getItem('selectedShipments')
if (savedShipments) {
try {
setSelectedShipments(JSON.parse(savedShipments))
} catch (error) {
console.error('Error parsing saved shipments:', error)
}
setSelectedShipments(JSON.parse(savedShipments))
}
}, [])
-4
View File
@@ -48,7 +48,6 @@ const ComparePageContent: NextPage = () => {
// اضافه کردن محصول به لیست مقایسه
const newProductIds = [...productIds, productIdStr]
console.log('New product IDs:', newProductIds)
setProductIds(newProductIds)
// به‌روزرسانی URL با محصولات جدید
@@ -65,12 +64,10 @@ const ComparePageContent: NextPage = () => {
const productId = search.get('productId')
const productIdsParam = search.get('productIds')
console.log('URL params - productId:', productId, 'productIds:', productIdsParam)
if (productIdsParam) {
// اگر productIds در URL موجود است، آن را استفاده کن
const ids = productIdsParam.split(',').filter(id => id.trim())
console.log('Parsed product IDs:', ids)
setProductIds(ids)
// حذف productId قدیمی از URL
@@ -81,7 +78,6 @@ const ComparePageContent: NextPage = () => {
}
} else if (productId) {
// اگر فقط productId موجود است، آن را به productIds تبدیل کن
console.log('Single product ID:', productId)
setProductIds([productId])
// URL را به productIds تبدیل کن
-7
View File
@@ -5,18 +5,11 @@ import { CompareResponse } from "../types/Types";
export const getCompare = async (
productIds: string[]
): Promise<CompareResponse> => {
console.log("API call - productIds:", productIds);
// روش اول: ارسال آرایه به صورت جداگانه
const params = new URLSearchParams();
productIds.forEach((id) => {
params.append("productIds", id);
});
console.log("Final URL:", `/product/compare?${params.toString()}`);
const { data } = await axios.get(`/product/compare?${params.toString()}`);
console.log("API response:", data);
return data;
};
-4
View File
@@ -29,10 +29,6 @@ const Orders: NextPage = () => {
return statusMap[status] || status;
};
console.log('ordersData', ordersData);
return (
<div className='p-3 sm:p-4 md:p-6'>
<Menu pageActive='orders' />