fix(dashboard): Procurement-Pulse Buy-Signals card hit 404 endpoint

loadProcurementPulse called /api/procurement/reorder (does not exist) -> caught
-> always showed 0 Buy Signals. Correct route is /api/procurement/reorder-top,
which returns summary.buy_now. Fixed endpoint + count mapping (now shows 314).
This commit is contained in:
Rene Fichtmueller 2026-06-06 21:42:21 +00:00
parent bb4046bb1e
commit 87cd17808f

View File

@ -10542,14 +10542,14 @@ async function loadProcurementPulse() {
try { try {
// Fire all in parallel // Fire all in parallel
var [reorder, arb, squeeze, movers] = await Promise.all([ var [reorder, arb, squeeze, movers] = await Promise.all([
api('/api/procurement/reorder?limit=1').catch(function() { return null; }), api('/api/procurement/reorder-top?limit=1').catch(function() { return null; }),
api('/api/procurement/arbitrage?limit=1').catch(function() { return null; }), api('/api/procurement/arbitrage?limit=1').catch(function() { return null; }),
api('/api/procurement/supply-squeeze?limit=1').catch(function() { return null; }), api('/api/procurement/supply-squeeze?limit=1').catch(function() { return null; }),
api('/api/procurement/price-movers?days=7&limit=10').catch(function() { return null; }), api('/api/procurement/price-movers?days=7&limit=10').catch(function() { return null; }),
api('/api/equivalences?limit=1').catch(function() { return null; }), api('/api/equivalences?limit=1').catch(function() { return null; }),
]); ]);
var buySignals = reorder ? (reorder.total || (reorder.reorder_signals || []).length || 0) : 0; var buySignals = reorder && reorder.summary ? (reorder.summary.buy_now || 0) : 0;
var arbOps = arb ? (arb.total || (arb.opportunities || []).length || 0) : 0; var arbOps = arb ? (arb.total || (arb.opportunities || []).length || 0) : 0;
var supplyAlert = squeeze ? (squeeze.total || (squeeze.items || []).length || 0) : 0; var supplyAlert = squeeze ? (squeeze.total || (squeeze.items || []).length || 0) : 0;
var gainers = movers ? ((movers.gainers || []).length) : 0; var gainers = movers ? ((movers.gainers || []).length) : 0;