Closed YaleChen299 closed 1 year ago
Blocked by #97 (depends on the same migration file).
Direction looks good. Just one question: does setting to
nil
actually filterWHERE 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).
Direction looks good. Just one question: does setting to
nil
actually filterWHERE 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.
Edit: passing nil will get all the stories.
Ok, I will update the PR description.
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.