Entity validation
How do we validate fields that represent entities in our DTOs?
There are many ways to deal with this matter. Because of the way TypeORM naturally works, I'll first use an approach that will save us the work of having to modify the service at all and allow us to leave it untouched, as the relationships will be automatically mapped for us when saving the entity. After that, another approach that can be considered more "traditional", but we'll also learn an interesting concept. So, let's begin.
Last updated