lib/pact_broker/api/resources/group.rb in pact_broker-2.107.1 vs lib/pact_broker/api/resources/group.rb in pact_broker-2.108.0
- old
+ new
@@ -1,12 +1,15 @@
+require "pact_broker/string_refinements"
require "pact_broker/api/resources/base_resource"
require "pact_broker/api/decorators/relationships_csv_decorator"
module PactBroker
module Api
module Resources
class Group < BaseResource
+ using PactBroker::StringRefinements
+
def content_types_provided
[["text/csv", :to_csv]]
end
def allowed_methods
@@ -30,11 +33,17 @@
end
private
def group
- @group ||= group_service.find_group_containing(pacticipant)
+ @group ||= group_service.find_group_containing(pacticipant, max_pacticipants: max_pacticipants)
end
+
+ def max_pacticipants
+ if request.query["maxPacticipants"]&.integer?
+ request.query["maxPacticipants"].to_i
+ end
+ end
end
end
end
-end
\ No newline at end of file
+end