mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-27 21:34:54 +00:00
fix commissioning
This commit is contained in:
@ -65,7 +65,7 @@ export class DisableSpaceHandler
|
||||
}
|
||||
}
|
||||
|
||||
const tagUuids = space.tags?.map((tag) => tag.uuid) || [];
|
||||
const tagUuids = space.productAllocations?.map((tag) => tag.uuid) || [];
|
||||
/* const subspaceDtos =
|
||||
space.subspaces?.map((subspace) => ({
|
||||
subspaceUuid: subspace.uuid,
|
||||
|
||||
@ -582,8 +582,8 @@ export class SpaceService {
|
||||
queryRunner: QueryRunner,
|
||||
): Promise<void> {
|
||||
try {
|
||||
if (space.subspaces || space.tags) {
|
||||
if (space.tags) {
|
||||
if (space.subspaces || space.productAllocations) {
|
||||
if (space.productAllocations) {
|
||||
await this.spaceProductAllocationService.unlinkModels(
|
||||
space,
|
||||
queryRunner,
|
||||
|
||||
@ -118,7 +118,7 @@ export class TagService {
|
||||
await queryRunner.manager.update(
|
||||
this.tagRepository.target,
|
||||
{ uuid: tag.uuid },
|
||||
{ subspace, space: null },
|
||||
{ subspace },
|
||||
);
|
||||
tag.subspace = subspace;
|
||||
}
|
||||
@ -127,10 +127,9 @@ export class TagService {
|
||||
await queryRunner.manager.update(
|
||||
this.tagRepository.target,
|
||||
{ uuid: tag.uuid },
|
||||
{ subspace: null, space: space },
|
||||
{ subspace: null },
|
||||
);
|
||||
tag.subspace = null;
|
||||
tag.space = space;
|
||||
}
|
||||
|
||||
return tag;
|
||||
@ -367,7 +366,6 @@ export class TagService {
|
||||
where: [
|
||||
{
|
||||
tag,
|
||||
space: { uuid: spaceUuid },
|
||||
product: { uuid: productUuid },
|
||||
disabled: false,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user