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