springframeworkguru / sfg-pet-clinic

SFT Pet Clinic
232 stars 1.99k forks source link

When adding a new Pet, it doesn't appear in Owner's Pet list #95

Open jnz73 opened 5 years ago

jnz73 commented 5 years ago

In the newly added Pet, the OWNER_ID column in the database is null.

cassiusvm commented 5 years ago

Hello,

Please, see: https://github.com/cassiusvm/sfg-pet-clinic/commit/d452aadf8955d790884b0d9567838d0635271b1f

jnz73 commented 5 years ago

Yes, this way works. Adding hat line to the processUpdateForm method in the PetController solves Issue #99. I was wondering if is possible also to set the owner in the pet object through the thymeleaf form adding an hidden input (the same way we pass the Id) to fix both issues.