When I delete entity with softDelete column deletedAt and deletedBy are null or not set.
If I try softRemove, it only sets the deletedAt flag.
Here are some code for the entities:
@DeleteDateColumn({ name: 'deleted_at'})
deletedAt: Date;
@Column({ type: 'varchar', name: 'deleted_by', nullable: true })
deletedBy: string;
And for the services:
public async delete(id: string): Promise<void> {
const talent: Talent = await this.talentRepository.findOne(id);
if (!talent) throw new NotFoundException(`Talent with ID ${id} Not Found`);
talent.deletedBy = "John Doe";
await this.talentRepository.softDelete(talent);
}
If I log this service, the parameter deletedBy is set to "John Doe" but database is null.