Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions BE/apps/api-server/src/modules/mindmap/mindmap.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,6 @@ export class MindmapService {
throw new MindmapException('마인드맵을 찾을 수 없습니다.');
}

if (!nodes) {
return {
title: mindmap.title,
content: mindmap.content,
aiCount: mindmap.aiCount,
connectionId: mindmap.connectionId,
};
}
return {
title: mindmap.title,
content: mindmap.content,
Expand Down
10 changes: 8 additions & 2 deletions BE/libs/entity/src/mindmap.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@ export class Mindmap {
@Column({ name: 'ai_count', default: 5 })
aiCount: number;

@OneToMany(() => UserMindmapRole, (userMindmapRole) => userMindmapRole.mindmap)
@OneToMany(() => UserMindmapRole, (userMindmapRole) => userMindmapRole.mindmap, {
cascade: true,
onDelete: 'CASCADE',
})
userMindmapRoles: UserMindmapRole[];

@Column({ name: 'connection_id' })
connectionId: string;

@OneToMany(() => Node, (node) => node.mindmap)
@OneToMany(() => Node, (node) => node.mindmap, {
cascade: true,
onDelete: 'CASCADE',
})
nodes: Node[];

@CreateDateColumn({ type: 'timestamp', name: 'create_date' })
Expand Down
2 changes: 1 addition & 1 deletion BE/libs/entity/src/node.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class Node {
@PrimaryGeneratedColumn()
id: number;

@Column({ type: 'varchar', length: 32 })
@Column({ type: 'varchar', length: 128 })
keyword: string;

@Column({ name: 'location_x', type: 'float', default: 0 })
Expand Down
5 changes: 4 additions & 1 deletion BE/libs/entity/src/user.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export class User {
@CreateDateColumn({ type: 'timestamp', name: 'create_date' })
createDate: Date;

@OneToMany(() => UserMindmapRole, (userMindmapRole) => userMindmapRole.user)
@OneToMany(() => UserMindmapRole, (userMindmapRole) => userMindmapRole.user, {
cascade: true,
onDelete: 'CASCADE',
})
userMindmapRoles: UserMindmapRole[];
}
6 changes: 3 additions & 3 deletions BE/libs/entity/src/user.mindmap.role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ export class UserMindmapRole {
@PrimaryGeneratedColumn()
id: number;

@ManyToOne(() => User, (user) => user.userMindmapRoles, { onDelete: 'CASCADE', nullable: false })
@ManyToOne(() => User, (user) => user.userMindmapRoles, { nullable: false })
@JoinColumn({ name: 'user_id' })
user: User;

@ManyToOne(() => Mindmap, (mindmap) => mindmap.userMindmapRoles, { onDelete: 'CASCADE', nullable: false })
@ManyToOne(() => Mindmap, (mindmap) => mindmap.userMindmapRoles, { nullable: false })
@JoinColumn({ name: 'mindmap_id' })
mindmap: Mindmap;

@Column({ type: 'enum', enum: Role, default: Role.OWNER })
role: Role;

@DeleteDateColumn()
deleteAt: Date | null;
deletedAt: Date | null;
}