Check board game existence when adding to library
Closed this issue · 5 comments
When using POST /user/current/library_games
, board game id is added to user's library without check.
@waliens, should we check or it doesn't matter?
It shouldn't be possible to add a non-existing board game to a library or any other association (e.g event) because there is a foreign key constraint in the database. Were you able to add such a board game to a library ? If so, it is a bug and I need to investigate.
It was when writing a test, I got a 200 but haven't checked if it was recorded in DB. I'll investigate more and let you know :)
Indeed, the relation was successfully added to the table 🤔
I see the constraints on local or prod, not on testing env. Checking where is the difference...
Found the bug in the test script!