diff --git a/server/routes/detections.js b/server/routes/detections.js index f66da1c..f881f73 100644 --- a/server/routes/detections.js +++ b/server/routes/detections.js @@ -18,6 +18,7 @@ router.get('/', authenticateToken, async (req, res) => { try { // Get tenant from authenticated user context const tenantId = req.tenantId; + console.log('🔍 Looking for tenant with slug:', tenantId); if (!tenantId) { return res.status(400).json({ success: false, @@ -26,6 +27,7 @@ router.get('/', authenticateToken, async (req, res) => { } const tenant = await Tenant.findOne({ where: { slug: tenantId } }); + console.log('🔍 Tenant lookup result:', tenant ? `Found tenant ${tenant.slug}` : 'Tenant not found'); if (!tenant) { return res.status(404).json({ success: false,