fix(api): return correct events for profile

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-10-03 11:11:10 +02:00
parent edfc8c8d18
commit f45b02407c

View File

@@ -477,7 +477,7 @@ export async function getEventList({
}
if (profileId) {
sb.where.deviceId = `device_id IN (SELECT device_id as did FROM ${TABLE_NAMES.events} WHERE profile_id = ${escape(profileId)} group by did)`;
sb.where.deviceId = `(device_id IN (SELECT device_id as did FROM ${TABLE_NAMES.events} WHERE device_id != '' AND profile_id = ${escape(profileId)} group by did) OR profile_id = ${escape(profileId)})`;
}
if (startDate && endDate) {