♻️ Remove redundant item deletion logic in backend/app/api/routes/users.py#2253
♻️ Remove redundant item deletion logic in backend/app/api/routes/users.py#2253raphaeltannous wants to merge 8 commits into
backend/app/api/routes/users.py#2253Conversation
YuriiMotov
left a comment
There was a problem hiding this comment.
Makes sense!
But we should then add tests that check that items are also deleted.
Currently tests don't check that: https://github.com/fastapi/full-stack-fastapi-template/blob/master/backend/tests/api/routes/test_users.py
backend/app/api/routes/users.py
Hey! I've added 2 tests to check that the items are deleted. |
Updated. |
Found an issue in the test implementation
|
You are right! I did not notice that. I created |
YuriiMotov
left a comment
There was a problem hiding this comment.
LGTM!
@raphaeltannous, thanks!
Passing this to Sebastian
Hey!
Removed redundant manual item deletion in the user deletion endpoint, since the
SQLModelrelationship already hasON DELETE CASCADEconfigured, which automatically deletes all related items when a user is deleted.full-stack-fastapi-template/backend/app/models.py
Lines 93 to 95 in bba8d07