mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-17 03:05:13 +00:00
fixed deleting subspace
This commit is contained in:
@ -211,6 +211,7 @@ export class SpaceModelService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (dto.subspaceModels) {
|
if (dto.subspaceModels) {
|
||||||
|
console.log(JSON.stringify(modifiedSubspaces));
|
||||||
modifiedSubspaceModels =
|
modifiedSubspaceModels =
|
||||||
await this.subSpaceModelService.modifySubSpaceModels(
|
await this.subSpaceModelService.modifySubSpaceModels(
|
||||||
modifiedSubspaces,
|
modifiedSubspaces,
|
||||||
|
@ -243,15 +243,19 @@ export class SubSpaceModelService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (subspaceModel.tags?.length) {
|
if (subspaceModel.tags?.length) {
|
||||||
const modifyTagDtos = subspaceModel.tags.map((tag) => ({
|
const modifyTagDtos: CreateTagModelDto[] = subspaceModel.tags.map(
|
||||||
|
(tag) => ({
|
||||||
uuid: tag.uuid,
|
uuid: tag.uuid,
|
||||||
action: ModifyAction.DELETE,
|
action: ModifyAction.ADD,
|
||||||
}));
|
tag: tag.tag,
|
||||||
await this.tagModelService.modifyTags(
|
productUuid: tag.product.uuid,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
await this.tagModelService.moveTags(
|
||||||
modifyTagDtos,
|
modifyTagDtos,
|
||||||
queryRunner,
|
queryRunner,
|
||||||
|
subspaceModel.spaceModel,
|
||||||
null,
|
null,
|
||||||
subspaceModel,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -259,7 +263,7 @@ export class SubSpaceModelService {
|
|||||||
private async findOne(subspaceUuid: string): Promise<SubspaceModelEntity> {
|
private async findOne(subspaceUuid: string): Promise<SubspaceModelEntity> {
|
||||||
const subspace = await this.subspaceModelRepository.findOne({
|
const subspace = await this.subspaceModelRepository.findOne({
|
||||||
where: { uuid: subspaceUuid, disabled: false },
|
where: { uuid: subspaceUuid, disabled: false },
|
||||||
relations: ['tags', 'spaceModel'],
|
relations: ['tags', 'spaceModel', 'tags.product'],
|
||||||
});
|
});
|
||||||
if (!subspace) {
|
if (!subspace) {
|
||||||
throw new HttpException(
|
throw new HttpException(
|
||||||
|
Reference in New Issue
Block a user