Coding task · NestJS course · Module 3: TypeORM and Databases
Entity hooks and subscribers
Use entity hooks for automatic data validation and transformation.
Task
Write an entity with @BeforeInsert() that sets createdAt to new Date() and @BeforeUpdate() that sets updatedAt