Is it possible to cascade like soft delete when removing from parent entity?
Lets say I have:
class ParentEntity {
@OneToMany(() => ChildEntity, (ce) => ca.parentEntity)
childrenEntities: ChildEntity[];
}
class ChildEntity {
@ManyToOne(() => ParentEntity, (pe) => pe.childrenEntities)
parentEntity: ParentEntity;
@DeleteDateColumn()
deletedAt?: Date;
}
Is it possible to perform soft delete of ChildEntity from ParentEntity?
For example like:
//find parent
const parent = this.repo.find(...)
//remove from childrenEntities
parent.childrenEntities.splice(0, 1);
//save parent
this.repo.save(parent)