mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 10:54:55 +00:00
space cleanup
This commit is contained in:
@ -17,7 +17,6 @@ import { BaseResponseDto } from '@app/common/dto/base.response.dto';
|
||||
import { SpaceEntity } from '@app/common/modules/space/entities';
|
||||
import { generateRandomString } from '@app/common/helper/randomString';
|
||||
import { SpaceLinkService } from './space-link';
|
||||
import { SpaceProductService } from './space-products';
|
||||
import { CreateSubspaceModelDto } from 'src/space-model/dtos';
|
||||
import { SubSpaceService } from './subspace';
|
||||
import { DataSource, Not } from 'typeorm';
|
||||
@ -30,7 +29,6 @@ export class SpaceService {
|
||||
private readonly dataSource: DataSource,
|
||||
private readonly spaceRepository: SpaceRepository,
|
||||
private readonly spaceLinkService: SpaceLinkService,
|
||||
private readonly spaceProductService: SpaceProductService,
|
||||
private readonly subSpaceService: SubSpaceService,
|
||||
private readonly validationService: ValidationService,
|
||||
) {}
|
||||
@ -102,13 +100,6 @@ export class SpaceService {
|
||||
);
|
||||
}
|
||||
|
||||
if (products && products.length > 0) {
|
||||
await this.spaceProductService.assignProductsToSpace(
|
||||
newSpace,
|
||||
products,
|
||||
queryRunner,
|
||||
);
|
||||
}
|
||||
await queryRunner.commitTransaction();
|
||||
|
||||
return new SuccessResponseDto({
|
||||
@ -264,14 +255,9 @@ export class SpaceService {
|
||||
Object.assign(space, updateSpaceDto, { parent });
|
||||
|
||||
// Save the updated space
|
||||
const updatedSpace = await queryRunner.manager.save(space);
|
||||
await queryRunner.manager.save(space);
|
||||
|
||||
if (products && products.length > 0) {
|
||||
await this.spaceProductService.assignProductsToSpace(
|
||||
updatedSpace,
|
||||
products,
|
||||
queryRunner,
|
||||
);
|
||||
}
|
||||
await queryRunner.commitTransaction();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user