mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 10:25:23 +00:00
Add utility function to associate space UUID with devices in community and device services
This commit is contained in:
11
libs/common/src/util/device-utils.ts
Normal file
11
libs/common/src/util/device-utils.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { DeviceEntity } from '../modules/device/entities';
|
||||
|
||||
export function addSpaceUuidToDevices(
|
||||
devices: DeviceEntity[],
|
||||
spaceUuid: string,
|
||||
): DeviceEntity[] {
|
||||
return devices.map((device) => {
|
||||
(device as any).spaceUuid = spaceUuid;
|
||||
return device;
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user