Fix jwt-token

This commit is contained in:
2025-09-18 06:39:02 +02:00
parent 8d446b76c8
commit f7db9b7a37

View File

@@ -126,6 +126,14 @@ router.get('/', authenticateToken, async (req, res) => {
});
console.log(`🔍 Detections query - found ${detections.length} detections for tenant ${tenant.slug}`);
console.log(`🔍 Detection data being returned:`, JSON.stringify(detections.map(d => ({
id: d.id,
device_id: d.device_id,
drone_id: d.drone_id,
drone_type: d.drone_type,
server_timestamp: d.server_timestamp,
device: d.device ? { id: d.device.id, name: d.device.name } : null
})), null, 2));
// Get total count for pagination (also filtered by tenant)
const totalCount = await DroneDetection.count({