Merge pull request #258 from SyncrowIOT/fix-get-device-by-project

Add project UUID filter to device query in DeviceService
This commit is contained in:
faris Aljohari
2025-02-17 01:16:36 -06:00
committed by GitHub

View File

@ -960,7 +960,12 @@ export class DeviceService {
await this.validateProject(param.projectUuid); await this.validateProject(param.projectUuid);
const devices = await this.deviceRepository.find({ const devices = await this.deviceRepository.find({
where: { isActive: true }, where: {
isActive: true,
spaceDevice: {
community: { project: { uuid: param.projectUuid } },
},
},
relations: [ relations: [
'spaceDevice.parent', 'spaceDevice.parent',
'spaceDevice.community', 'spaceDevice.community',