removed logs

This commit is contained in:
hannathkadher
2025-01-31 11:07:06 +04:00
parent f77d52b6be
commit a8f966a221
5 changed files with 63 additions and 63 deletions
@@ -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);