fix issues

This commit is contained in:
hannathkadher
2025-03-12 01:36:10 +04:00
parent 67a78dbdfd
commit 1ce2f3c3cc
7 changed files with 122 additions and 78 deletions
@@ -440,11 +440,12 @@ export class SpaceModelService {
queryRunner?: QueryRunner, // Make queryRunner optional
): Promise<void> {
try {
space.spaceModel = spaceModel;
if (queryRunner) {
await queryRunner.manager.save(SpaceEntity, space);
await queryRunner.manager.update(SpaceEntity, space.uuid, {
spaceModel,
});
} else {
await this.spaceRepository.save(space);
await this.spaceRepository.update(space.uuid, { spaceModel });
}
const spaceProductAllocations = spaceModel.productAllocations.map(
(modelAllocation) =>
@@ -281,7 +281,7 @@ export class SubspaceModelProductAllocationService {
queryRunner: QueryRunner,
spaceModel: SpaceModelEntity,
spaceTagUpdateDtos?: ModifyTagModelDto[],
) {
): Promise<IUpdatedAllocations[]> {
const spaceAllocationToExclude: SpaceModelProductAllocationEntity[] = [];
const updatedAllocations: IUpdatedAllocations[] = [];
@@ -145,13 +145,14 @@ export class SubSpaceModelService {
);
const combineModels = [...createdSubspaces, ...updatedSubspaces];
await this.productAllocationService.updateAllocations(
combineModels,
projectUuid,
queryRunner,
spaceModel,
spaceTagUpdateDtos,
);
const updatedAllocations =
await this.productAllocationService.updateAllocations(
combineModels,
projectUuid,
queryRunner,
spaceModel,
spaceTagUpdateDtos,
);
const deletedSubspaces = await this.deleteSubspaceModels(
deleteDtos,