icons bug

This commit is contained in:
2025-12-16 14:21:49 +03:30
parent d0ba911be3
commit e9fab9d695
3 changed files with 9 additions and 8 deletions
+5 -2
View File
@@ -1,4 +1,4 @@
import { Entity, Index, Property, Collection, OneToMany } from '@mikro-orm/core';
import { Entity, Index, Property, Collection, OneToMany, Cascade } from '@mikro-orm/core';
import { BaseEntity } from '../../../common/entities/base.entity';
import { Icon } from './icon.entity';
@@ -7,6 +7,9 @@ export class Group extends BaseEntity {
@Property()
name!: string;
@OneToMany(() => Icon, icon => icon.group)
@OneToMany(() => Icon, icon => icon.group,{
cascade: [Cascade.ALL],
orphanRemoval: true,
})
icons = new Collection<Icon>(this);
}