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