Fix Demo enterprise
This commit is contained in:
@@ -23,7 +23,7 @@ import {
|
||||
useApprovePurchaseOrder,
|
||||
useStartProductionBatch,
|
||||
} from '../../api/hooks/useProfessionalDashboard';
|
||||
import { useDashboardData, useDashboardRealtimeSync } from '../../api/hooks/useDashboardData';
|
||||
import { useControlPanelData, useControlPanelRealtimeSync } from '../../api/hooks/useControlPanelData';
|
||||
import { useRejectPurchaseOrder } from '../../api/hooks/purchase-orders';
|
||||
import { useIngredients } from '../../api/hooks/inventory';
|
||||
import { useSuppliers } from '../../api/hooks/suppliers';
|
||||
@@ -99,15 +99,15 @@ export function BakeryDashboard({ plan }: { plan?: string }) {
|
||||
);
|
||||
const qualityTemplates = Array.isArray(qualityData?.templates) ? qualityData.templates : [];
|
||||
|
||||
// NEW: Single unified data fetch for all 4 dashboard blocks
|
||||
// NEW: Enhanced control panel data fetch with SSE integration
|
||||
const {
|
||||
data: dashboardData,
|
||||
isLoading: dashboardLoading,
|
||||
refetch: refetchDashboard,
|
||||
} = useDashboardData(tenantId);
|
||||
} = useControlPanelData(tenantId);
|
||||
|
||||
// Enable SSE real-time state synchronization
|
||||
useDashboardRealtimeSync(tenantId);
|
||||
// Enable enhanced SSE real-time state synchronization
|
||||
useControlPanelRealtimeSync(tenantId);
|
||||
|
||||
// Mutations
|
||||
const approvePO = useApprovePurchaseOrder();
|
||||
@@ -417,6 +417,7 @@ export function BakeryDashboard({ plan }: { plan?: string }) {
|
||||
runningBatches={dashboardData?.runningBatches || []}
|
||||
pendingBatches={dashboardData?.pendingBatches || []}
|
||||
alerts={dashboardData?.alerts || []}
|
||||
equipmentAlerts={dashboardData?.equipmentAlerts || []}
|
||||
loading={dashboardLoading}
|
||||
onStartBatch={handleStartBatch}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user