Fix jwt-token

This commit is contained in:
2025-08-28 12:05:30 +02:00
parent 4ecb2f65a8
commit fb334e30db

View File

@@ -11,9 +11,6 @@ const router = express.Router();
*/
router.get('/', authenticateToken, async (req, res) => {
try {
console.log('🔍 DETECTIONS ROUTE HIT - req.url:', req.originalUrl);
console.log('🔍 Query params:', req.query);
const {
device_id,
drone_id,
@@ -47,13 +44,6 @@ router.get('/', authenticateToken, async (req, res) => {
// Calculate offset for pagination
const offset = (parseInt(page) - 1) * parseInt(limit);
console.log('🔍 About to query with whereClause:', whereClause);
console.log('🔍 Include config:', {
model: 'Device',
as: 'device',
attributes: ['id', 'name', 'geo_lat', 'geo_lon', 'location_description', 'is_approved']
});
// Query detections with device information
const detections = await DroneDetection.findAll({
where: whereClause,
@@ -64,8 +54,7 @@ router.get('/', authenticateToken, async (req, res) => {
}],
order: [[sort, order.toUpperCase()]],
limit: parseInt(limit),
offset: offset,
logging: console.log // Enable SQL logging for this query
offset: offset
});
// Get total count for pagination