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