From d9997c456d4b46ea581ec165f755e1e56369afe6 Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Tue, 16 Sep 2025 22:11:04 +0200 Subject: [PATCH] Fix jwt-token --- server/routes/detections.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/server/routes/detections.js b/server/routes/detections.js index b9f8632..f66da1c 100644 --- a/server/routes/detections.js +++ b/server/routes/detections.js @@ -298,7 +298,10 @@ router.get('/:id', authenticateToken, async (req, res) => { }); if (!detection) { - return res.status(404).json({ error: 'Detection not found in your tenant' }); + return res.status(404).json({ + success: false, + message: 'Detection not found in your tenant' + }); } // Enhance detection with drone type information @@ -308,12 +311,16 @@ router.get('/:id', authenticateToken, async (req, res) => { drone_type_info: droneTypeInfo }; - res.json(enhancedDetection); + res.json({ + success: true, + data: enhancedDetection + }); } catch (error) { console.error('Error fetching detection:', error); res.status(500).json({ - error: 'Failed to fetch detection', + success: false, + message: 'Failed to fetch detection', details: error.message }); }