Fix jwt-token
This commit is contained in:
@@ -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
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user