Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pet details are not updated #1752

Open
99MMRR99 opened this issue Dec 19, 2024 · 7 comments
Open

Pet details are not updated #1752

99MMRR99 opened this issue Dec 19, 2024 · 7 comments

Comments

@99MMRR99
Copy link

Example: go to first owner with pet Leo of type cat.
Click on edit pet and change the type to bird or change the name.
Click on Update pet.
The pet is not updated, even though a success message is shown.
When I analysed the code, I found that the updated pet is given to the addPet method of the owner which does not change the pet in the owner list, as the pet is not new.
In PetController:
grafik

@smnk107
Copy link

smnk107 commented Dec 19, 2024

Hey !
I would like to work on this issue. Could you please assign it to me?

@99MMRR99
Copy link
Author

It seems that I cannot assign anybody to the issue, I dont know why, but feel free to fix the issue.

@smnk107
Copy link

smnk107 commented Dec 19, 2024

Okey !

@smnk107
Copy link

smnk107 commented Dec 20, 2024

Hello !
I have submitted a PR for this issue. Please review it when you have the time. Let me know if further improvements are needed. Thanks!

@99MMRR99
Copy link
Author

The solution is good and solves the problem. I would only suggest to put the whole logic with the for loop into a new method in the Owner (maybe call it updatePet). And I am not sure why you renamed the PetController to privatePetController.
Otherwise good work, thank you for fixing it!

@smnk107
Copy link

smnk107 commented Dec 22, 2024

Okey...sure ! I will correct the things.

@smnk107
Copy link

smnk107 commented Dec 22, 2024

I have created a new PR. Please review it !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants