From 16bb64ae8c70e47eb783c4871080d57b5241c5d1 Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Thu, 28 Aug 2025 11:52:52 +0200 Subject: [PATCH] Fix jwt-token --- server/routes/detections.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/routes/detections.js b/server/routes/detections.js index 60793df..6fb70d9 100644 --- a/server/routes/detections.js +++ b/server/routes/detections.js @@ -17,7 +17,7 @@ router.get('/', authenticateToken, async (req, res) => { end_date, page = 1, limit = 50, - sort = 'timestamp', + sort = 'server_timestamp', order = 'desc' } = req.query; @@ -33,11 +33,11 @@ router.get('/', authenticateToken, async (req, res) => { } if (start_date) { - whereClause.timestamp = { ...whereClause.timestamp, gte: new Date(start_date) }; + whereClause.server_timestamp = { ...whereClause.server_timestamp, gte: new Date(start_date) }; } if (end_date) { - whereClause.timestamp = { ...whereClause.timestamp, lte: new Date(end_date) }; + whereClause.server_timestamp = { ...whereClause.server_timestamp, lte: new Date(end_date) }; } // Calculate offset for pagination @@ -49,7 +49,7 @@ router.get('/', authenticateToken, async (req, res) => { include: [{ model: Device, as: 'device', - attributes: ['id', 'device_name', 'device_type', 'location', 'latitude', 'longitude'] + attributes: ['id', 'name', 'geo_lat', 'geo_lon', 'location_description', 'is_approved'] }], order: [[sort, order.toUpperCase()]], limit: parseInt(limit), @@ -108,7 +108,7 @@ router.get('/:id', authenticateToken, async (req, res) => { include: [{ model: Device, as: 'device', - attributes: ['id', 'device_name', 'device_type', 'location', 'latitude', 'longitude'] + attributes: ['id', 'name', 'geo_lat', 'geo_lon', 'location_description', 'is_approved'] }] });