removed console
This commit is contained in:
parent
fca7cbbcac
commit
dfe9177e8b
@ -209,12 +209,10 @@ const ProductData = ({
|
||||
const productsController = new AbortController();
|
||||
const unitsController = new AbortController();
|
||||
const loadReasons = async () => {
|
||||
console.log('Fetching variation reasons...');
|
||||
setIsLoadingReasons(true);
|
||||
setReasonsError('');
|
||||
try {
|
||||
const reasons = await fetchVariationReasons({ signal: variationController.signal });
|
||||
console.log('Variation reasons fetched:', reasons);
|
||||
setVariationReasons(reasons);
|
||||
setReasonsError('');
|
||||
} catch (error) {
|
||||
@ -249,7 +247,6 @@ const ProductData = ({
|
||||
setProductsError('');
|
||||
try {
|
||||
const productsList = await fetchProducts({ signal: productsController.signal });
|
||||
console.log('Products fetched:', productsList);
|
||||
setProductOptions(productsList);
|
||||
setProductsError('');
|
||||
} catch (error) {
|
||||
@ -431,7 +428,6 @@ const ProductData = ({
|
||||
productId
|
||||
);
|
||||
|
||||
console.log('API Response:', response);
|
||||
|
||||
if (!response) {
|
||||
console.warn('Empty response from getPreviousForecastData');
|
||||
@ -511,7 +507,6 @@ const ProductData = ({
|
||||
localStorage.getItem('establishmentId') ||
|
||||
localStorage.getItem('establishment_id');
|
||||
|
||||
console.log('Retrieved establishment ID:', establishmentId);
|
||||
|
||||
if (establishmentId && quarter && year) {
|
||||
// Get the actual product ID from the selected product object
|
||||
@ -605,10 +600,7 @@ const ProductData = ({
|
||||
}
|
||||
|
||||
try {
|
||||
console.log('Fetching forecast data...');
|
||||
const forecastData = await fetchPreviousForecastData(productId, establishmentId);
|
||||
console.log('Forecast data received:', forecastData);
|
||||
|
||||
const forecastData = await fetchPreviousForecastData(productId, establishmentId);
|
||||
if (!forecastData) {
|
||||
console.warn('No forecast data received for product:', productId);
|
||||
return;
|
||||
|
||||
@ -172,11 +172,9 @@ const buildProductRows = (products = [], options = {}) => {
|
||||
try {
|
||||
// Find the full product details from productOptions if available
|
||||
const fullProduct = productOptions.find(p => p.id === product.productId || p.value === product.productId);
|
||||
console.log("fullProduct",fullProduct)
|
||||
// Extract product details with better fallbacks
|
||||
const productId = product.id || `product-${Math.random().toString(36).substr(2, 9)}`;
|
||||
const productName = fullProduct?.label || fullProduct?.name || product.productName || product.product?.name || product.product;
|
||||
console.log("productName",productName)
|
||||
const productCode = fullProduct?.code || product.productCode || product.code || product.product?.code || product.id || `CODE-${index + 1}`;
|
||||
console.log("productCode",productCode)
|
||||
// Use stored unitName if available, otherwise try to find it in unitOptions
|
||||
|
||||
@ -76,9 +76,7 @@ const AdminUsers = () => {
|
||||
const fetchUsers = async () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
console.log('Fetching admin users...'); // Debug log
|
||||
const response = await getAdminUser();
|
||||
console.log('API Response:', response); // Debug log
|
||||
|
||||
// Check if response is an array directly or if it's in a data property
|
||||
const usersData = Array.isArray(response) ? response :
|
||||
@ -104,7 +102,6 @@ const AdminUsers = () => {
|
||||
is_active: user.is_active, // Keep the original is_active for reference
|
||||
}));
|
||||
|
||||
console.log('Mapped users:', mappedUsers); // Debug log
|
||||
setUsers(mappedUsers);
|
||||
} else {
|
||||
const errorMsg = 'Invalid response format: Expected an array of users';
|
||||
@ -176,9 +173,7 @@ const AdminUsers = () => {
|
||||
|
||||
try {
|
||||
setLoading(true);
|
||||
console.log('Fetching user data for ID:', user.id); // Debug log
|
||||
const userData = await getAdminUserById(user.id);
|
||||
console.log('User data received:', userData); // Debug log
|
||||
|
||||
if (!userData) {
|
||||
throw new Error('No user data received');
|
||||
|
||||
@ -329,10 +329,8 @@ const EditCompanyProfile = ({ onClose: propOnClose }) => {
|
||||
// Fetch establishment details when ID is provided
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
console.log('Establishment ID:', establishmentId);
|
||||
|
||||
if (!establishmentId) {
|
||||
console.log('No establishment ID provided');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -24,7 +24,6 @@ const SubmissionDeadlines = () => {
|
||||
|
||||
const handleSave = () => {
|
||||
// Future: Replace with save logic
|
||||
console.log('Saving submission deadlines', form);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@ -56,15 +56,10 @@ const UnitMaster = () => {
|
||||
const fetchUnits = async () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const response = await getUnits();
|
||||
console.log("API Response:", response); // Log the full response
|
||||
|
||||
const response = await getUnits();
|
||||
const unitsData = response.data || [];
|
||||
console.log("Units Data:", unitsData); // Log the units data
|
||||
|
||||
// Process units to ensure mapped_products_count is included
|
||||
const processedUnits = unitsData.map(unit => {
|
||||
console.log("Processing unit:", unit); // Log each unit being processed
|
||||
return {
|
||||
...unit,
|
||||
mapped_products_count: unit.mapped_products_count !== undefined
|
||||
@ -73,7 +68,6 @@ const fetchUnits = async () => {
|
||||
};
|
||||
});
|
||||
|
||||
console.log("Processed Units:", processedUnits); // Log the processed units
|
||||
|
||||
// Sort by latest created_at date (newest first)
|
||||
const sortedUnits = [...processedUnits].sort(
|
||||
@ -119,8 +113,6 @@ const fetchUnits = async () => {
|
||||
: '-';
|
||||
const currentUserName = currentUser?.name || '';
|
||||
|
||||
console.log("Rendering row with item:", item); // Log the item being rendered
|
||||
|
||||
return [
|
||||
item.uom || item.unitName, // Unit Name
|
||||
item.uom_short_name || item.description, // Description
|
||||
|
||||
@ -396,7 +396,6 @@ const Survey = () => {
|
||||
}),
|
||||
};
|
||||
}, [establishmentData, parseNumber, productsData, stringify]);
|
||||
console.log("productsData",productsData)
|
||||
|
||||
const handleNext = () => {
|
||||
if (step < 3) {
|
||||
@ -420,7 +419,6 @@ const Survey = () => {
|
||||
|
||||
// Navigate to overview page after successful submission
|
||||
// navigate('/overview');
|
||||
console.log('Survey submission response:', response);
|
||||
showToast('success', response?.message || 'You have successfully submitted the survey.');
|
||||
setShowSuccessPopup(true);
|
||||
setHasSubmitted(true);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user