Closed Danielgergely closed 4 months ago
I will do this today
I just went over it and the code already has such a check when calling addPlantToSpace(). I also just added a test to ensure this works.
When did you encounter this bug? Because on my side it seems to work as expected
I just saw that sometimes a plant has the same user more then once in its caretakers list. I think the check you implemented should now prevent this. (It could be that these users were added already before any checks were implemented)
A user should not be added to a plant as a caretaker multiple times. If user is added to a space in which there is a plant of which he/she is already caretaker of, then he/she should not be added again as a caretaker. Please implement a check which makes sure that a user will not be added twice to the same plant as a caretaker.