mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-26 00:27:56 +00:00
removed logs
This commit is contained in:
@@ -82,34 +82,12 @@ export class SubspaceDeviceService {
|
||||
|
||||
const subspace = await this.findSubspace(subSpaceUuid);
|
||||
const device = await this.findDevice(deviceUuid);
|
||||
console.log(device);
|
||||
|
||||
if (device.tag) {
|
||||
console.log(device.tag);
|
||||
const tag = device.tag;
|
||||
if (tag.subspace !== null && tag.subspace.uuid === subspace.uuid) {
|
||||
//do nothing
|
||||
}
|
||||
if (tag.subspace !== null && tag.subspace.uuid !== subspace.uuid) {
|
||||
await this.tagRepository.update(
|
||||
{
|
||||
uuid: tag.uuid,
|
||||
},
|
||||
{
|
||||
subspace: subspace,
|
||||
},
|
||||
);
|
||||
}
|
||||
if (tag.subspace === null) {
|
||||
await this.tagRepository.update(
|
||||
{
|
||||
uuid: tag.uuid,
|
||||
},
|
||||
{
|
||||
subspace: subspace,
|
||||
},
|
||||
);
|
||||
}
|
||||
if (device.tag?.subspace?.uuid !== subspace.uuid) {
|
||||
await this.tagRepository.update(
|
||||
{ uuid: device.tag.uuid },
|
||||
{ subspace },
|
||||
);
|
||||
}
|
||||
|
||||
device.subspace = subspace;
|
||||
@@ -154,24 +132,13 @@ export class SubspaceDeviceService {
|
||||
);
|
||||
}
|
||||
|
||||
if (device.tag) {
|
||||
console.log(device.tag);
|
||||
const tag = device.tag;
|
||||
if (tag.subspace === null) {
|
||||
//do nothing
|
||||
}
|
||||
if (tag.subspace !== null) {
|
||||
await this.tagRepository.update(
|
||||
{
|
||||
uuid: tag.uuid,
|
||||
},
|
||||
{
|
||||
subspace: null,
|
||||
space: device.subspace,
|
||||
},
|
||||
);
|
||||
}
|
||||
if (device.tag?.subspace !== null) {
|
||||
await this.tagRepository.update(
|
||||
{ uuid: device.tag.uuid },
|
||||
{ subspace: null, space: device.subspace },
|
||||
);
|
||||
}
|
||||
|
||||
device.subspace = null;
|
||||
const updatedDevice = await this.deviceRepository.save(device);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user