diff options
Diffstat (limited to 'qa/qa/resource/events/base.rb')
-rw-r--r-- | qa/qa/resource/events/base.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/qa/qa/resource/events/base.rb b/qa/qa/resource/events/base.rb index 91ec0e59e37..4c5f54825b3 100644 --- a/qa/qa/resource/events/base.rb +++ b/qa/qa/resource/events/base.rb @@ -9,9 +9,12 @@ module QA EventNotFoundError = Class.new(RuntimeError) module Base - def events(action: nil) + def events(action: nil, target_type: nil) + query = [] + query << "action=#{CGI.escape(action)}" if action + query << "target_type=#{CGI.escape(target_type)}" if target_type path = [api_get_events] - path << "?action=#{CGI.escape(action)}" if action + path << "?#{query.join("&")}" unless query.empty? parse_body(api_get_from("#{path.join}")) end |