mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-16 02:36:19 +00:00
Add space device relation and space name to device details
This commit is contained in:
@ -517,7 +517,7 @@ export class VisitorPasswordService {
|
|||||||
isActive: true,
|
isActive: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
relations: ['productDevice'],
|
relations: ['productDevice', 'spaceDevice'],
|
||||||
});
|
});
|
||||||
const devicesData = await Promise.all(
|
const devicesData = await Promise.all(
|
||||||
devices?.map(async (device) => {
|
devices?.map(async (device) => {
|
||||||
@ -531,6 +531,7 @@ export class VisitorPasswordService {
|
|||||||
productType: device.productDevice.prodType,
|
productType: device.productDevice.prodType,
|
||||||
...deviceDetails,
|
...deviceDetails,
|
||||||
uuid: device.uuid,
|
uuid: device.uuid,
|
||||||
|
spaceName: device.spaceDevice.spaceName,
|
||||||
} as GetDeviceDetailsInterface;
|
} as GetDeviceDetailsInterface;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(
|
console.error(
|
||||||
|
Reference in New Issue
Block a user