Fix jwt-token
This commit is contained in:
@@ -224,10 +224,7 @@ router.get('/activity', authenticateToken, async (req, res) => {
|
||||
timestamp: heartbeat.received_at,
|
||||
data: {
|
||||
device_id: heartbeat.device_id,
|
||||
device_name: heartbeat.device.name || `Device ${heartbeat.device_id}`,
|
||||
battery_level: heartbeat.battery_level,
|
||||
signal_strength: heartbeat.signal_strength,
|
||||
temperature: heartbeat.temperature
|
||||
device_name: heartbeat.device.name || `Device ${heartbeat.device_id}`
|
||||
}
|
||||
}))
|
||||
];
|
||||
|
||||
@@ -89,8 +89,7 @@ router.get('/heartbeat-payloads', authenticateToken, async (req, res) => {
|
||||
limit: parseInt(limit),
|
||||
offset: parseInt(offset),
|
||||
attributes: [
|
||||
'id', 'device_id', 'device_key', 'signal_strength', 'battery_level',
|
||||
'temperature', 'received_at', 'raw_payload'
|
||||
'id', 'device_id', 'device_key', 'received_at', 'raw_payload'
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
@@ -50,9 +50,6 @@ const detectorSchema = Joi.alternatives().try(
|
||||
geo_lat: Joi.number().min(-90).max(90).optional(),
|
||||
geo_lon: Joi.number().min(-180).max(180).optional(),
|
||||
location_description: Joi.string().optional(),
|
||||
signal_strength: Joi.number().integer().optional(),
|
||||
battery_level: Joi.number().integer().min(0).max(100).optional(),
|
||||
temperature: Joi.number().optional(),
|
||||
uptime: Joi.number().integer().min(0).optional(),
|
||||
memory_usage: Joi.number().integer().min(0).max(100).optional(),
|
||||
firmware_version: Joi.string().optional()
|
||||
|
||||
@@ -77,7 +77,7 @@ router.get('/', authenticateToken, async (req, res) => {
|
||||
limit: 1,
|
||||
order: [['received_at', 'DESC']],
|
||||
required: false,
|
||||
attributes: ['received_at', 'battery_level', 'signal_strength', 'temperature']
|
||||
attributes: ['received_at']
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user