mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 22:04:53 +00:00
fix delete dto
This commit is contained in:
@ -108,7 +108,7 @@ export class SubSpaceModelService {
|
||||
|
||||
const addDtos = dtos.filter((dto) => dto.action === ModifyAction.ADD);
|
||||
const combinedDtos = dtos.filter((dto) => dto.action !== ModifyAction.ADD);
|
||||
const deleteDtos = dtos.filter((dto) => dto.action !== ModifyAction.DELETE);
|
||||
const deleteDtos = dtos.filter((dto) => dto.action === ModifyAction.DELETE);
|
||||
|
||||
const updatedModels = await this.updateSubspaceModel(
|
||||
combinedDtos,
|
||||
@ -306,8 +306,6 @@ export class SubSpaceModelService {
|
||||
for (const dto of dtos) {
|
||||
if (!dto.subspaceName) continue;
|
||||
|
||||
await this.checkDuplicateNames(dto.subspaceName, spaceModel.uuid);
|
||||
|
||||
const existingSubspace = await queryRunner.manager.findOne(
|
||||
this.subspaceModelRepository.target,
|
||||
{ where: { uuid: dto.uuid } },
|
||||
@ -317,6 +315,9 @@ export class SubSpaceModelService {
|
||||
existingSubspace &&
|
||||
existingSubspace.subspaceName !== dto.subspaceName
|
||||
) {
|
||||
if (existingSubspace.subspaceName !== dto.subspaceName) {
|
||||
await this.checkDuplicateNames(dto.subspaceName, spaceModel.uuid);
|
||||
}
|
||||
existingSubspace.subspaceName = dto.subspaceName;
|
||||
await queryRunner.manager.save(existingSubspace);
|
||||
updatedSubspaces.push({
|
||||
|
||||
Reference in New Issue
Block a user