mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 20:04:54 +00:00
add subspace relation
This commit is contained in:
@ -100,7 +100,7 @@ export class SubspaceDeviceService {
|
||||
|
||||
if (!device.subspace || device.subspace.uuid !== subspace.uuid) {
|
||||
throw new HttpException(
|
||||
'Device is not associated with the specified subspace',
|
||||
`Device ${deviceUuid} is not associated with the specified subspace ${subSpaceUuid} `,
|
||||
HttpStatus.BAD_REQUEST,
|
||||
);
|
||||
}
|
||||
@ -169,6 +169,7 @@ export class SubspaceDeviceService {
|
||||
private async findDevice(deviceUuid: string) {
|
||||
const device = await this.deviceRepository.findOne({
|
||||
where: { uuid: deviceUuid },
|
||||
relations: ['subspace'],
|
||||
});
|
||||
if (!device) {
|
||||
this.throwNotFound('Device', deviceUuid);
|
||||
|
||||
Reference in New Issue
Block a user