Fix jwt-token
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { Device, AlertRule, AlertLog, Heartbeat } = require('../models');
|
||||
const { Device, AlertRule, AlertLog, Heartbeat, sequelize } = require('../models');
|
||||
const { Op } = require('sequelize');
|
||||
|
||||
class DeviceHealthService {
|
||||
@@ -133,7 +133,8 @@ class DeviceHealthService {
|
||||
// Rules that monitor all devices (device_ids is null)
|
||||
{ device_ids: null },
|
||||
// Rules that specifically include this device
|
||||
{ device_ids: { [Op.contains]: [device.id] } }
|
||||
// Use a simple approach - convert device ID to string and check if it's in the JSON array
|
||||
sequelize.literal(`device_ids::text LIKE '%${device.id}%'`)
|
||||
]
|
||||
}
|
||||
});
|
||||
@@ -171,7 +172,8 @@ class DeviceHealthService {
|
||||
// Rules that monitor all devices (device_ids is null)
|
||||
{ device_ids: null },
|
||||
// Rules that specifically include this device
|
||||
{ device_ids: { [Op.contains]: [device.id] } }
|
||||
// Use a simple approach - convert device ID to string and check if it's in the JSON array
|
||||
sequelize.literal(`device_ids::text LIKE '%${device.id}%'`)
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user