mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 18:27:05 +00:00
Merge pull request #269 from SyncrowIOT/feat/fix-delete-propagation
This commit is contained in:
@ -22,7 +22,6 @@ export class PropogateDeleteSpaceModelHandler
|
|||||||
const { spaceModel, queryRunner } = command.param;
|
const { spaceModel, queryRunner } = command.param;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await queryRunner.connect();
|
|
||||||
await queryRunner.startTransaction();
|
await queryRunner.startTransaction();
|
||||||
const spaces = await this.spaceRepository.find({
|
const spaces = await this.spaceRepository.find({
|
||||||
where: {
|
where: {
|
||||||
@ -43,6 +42,7 @@ export class PropogateDeleteSpaceModelHandler
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
await queryRunner.commitTransaction();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await queryRunner.rollbackTransaction();
|
await queryRunner.rollbackTransaction();
|
||||||
this.logger.error(
|
this.logger.error(
|
||||||
|
@ -295,6 +295,7 @@ export class SpaceModelService {
|
|||||||
{ uuid: param.spaceModelUuid },
|
{ uuid: param.spaceModelUuid },
|
||||||
{ disabled: true },
|
{ disabled: true },
|
||||||
);
|
);
|
||||||
|
await queryRunner.commitTransaction();
|
||||||
|
|
||||||
await this.commandBus.execute(
|
await this.commandBus.execute(
|
||||||
new PropogateDeleteSpaceModelCommand({
|
new PropogateDeleteSpaceModelCommand({
|
||||||
@ -303,8 +304,6 @@ export class SpaceModelService {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
await queryRunner.commitTransaction();
|
|
||||||
|
|
||||||
return new SuccessResponseDto({
|
return new SuccessResponseDto({
|
||||||
message: `SpaceModel with UUID ${param.spaceModelUuid} deleted successfully.`,
|
message: `SpaceModel with UUID ${param.spaceModelUuid} deleted successfully.`,
|
||||||
statusCode: HttpStatus.OK,
|
statusCode: HttpStatus.OK,
|
||||||
|
Reference in New Issue
Block a user