mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-14 09:57:28 +00:00
fixed delete bug
This commit is contained in:
@ -48,7 +48,10 @@ export class SpaceEntity extends AbstractEntity<SpaceDto> {
|
||||
@ManyToOne(() => SpaceEntity, (space) => space.children, { nullable: true })
|
||||
parent: SpaceEntity;
|
||||
|
||||
@OneToMany(() => SpaceEntity, (space) => space.parent)
|
||||
@OneToMany(() => SpaceEntity, (space) => space.parent, {
|
||||
nullable: false,
|
||||
onDelete: 'CASCADE',
|
||||
})
|
||||
children: SpaceEntity[];
|
||||
|
||||
@OneToMany(() => UserSpaceEntity, (userSpace) => userSpace.space)
|
||||
|
@ -126,8 +126,8 @@ export class SpaceService {
|
||||
try {
|
||||
// First, check if the community exists
|
||||
const space = await this.validateCommunityAndSpace(
|
||||
spaceUuid,
|
||||
communityUuid,
|
||||
spaceUuid,
|
||||
);
|
||||
|
||||
// Delete the space
|
||||
|
Reference in New Issue
Block a user