mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-25 15:47:55 +00:00
fix issues
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user