Small refactor of Boards::UsersFinder and Boards::MilestonesFinder
The following discussion from !40551 (merged) should be addressed:
-
@mkaeppler started a discussion: (+1 comment) It seems odd to first find all milestones, then perform this check later. Can we move this into the finder class instead? If we were to filter by milestone ID earlier (i.e. in the finder), then here we could simply test for whether the result was empty.
It would also make for better SRP since SQL belongs in the finders not the controllers.
digitalmoksha
:I agree, it would be better to do that if possible. The REST API uses the same style, https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/ee/api/boards_responses.rb#L45-65, so that should be cleaned up as well.
Edited by Brett Walker