-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add group filter to stories #98
Conversation
Blocked by #97 (depends on the same migration file). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direction looks good. Just one question: does setting to nil
actually filter WHERE group_id IS NULL
? Or does it simply ignore the field, can we test this behaviour?
I'm asking because when setting values, we need to explicitly use an NULL expression in gorm (nil fields are simply ignored, e.g. see #85). |
I think i have tests for that, when i use the struct where, with group id as null, it will explicit find those stories without groups. Actually, let me refine the tests. I might not cover the case well. Edit: passing nil will get all the stories. |
…ce-academy/stories-backend into add_group_filter_to_stories
Ok, I will update the PR description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for now, thanks!
Missing Permission check.
Current behaviour of the model function is:
In the controller, the current routing and middle ware guarantees that the list all route will have a valid groupID.
Part of #15.