Commit e3ba6d9c authored by Can Eldem's avatar Can Eldem Committed by Igor Drozdov

Skip filtering by domain if iid is given

parent bd0dab96
...@@ -32,6 +32,8 @@ module AlertManagement ...@@ -32,6 +32,8 @@ module AlertManagement
attr_reader :current_user, :project, :params attr_reader :current_user, :project, :params
def by_domain(collection) def by_domain(collection)
return collection if params[:iid].present?
collection.with_operations_alerts collection.with_operations_alerts
end end
......
...@@ -42,6 +42,12 @@ RSpec.describe AlertManagement::AlertsFinder, '#execute' do ...@@ -42,6 +42,12 @@ RSpec.describe AlertManagement::AlertsFinder, '#execute' do
it { is_expected.to contain_exactly(resolved_alert, ignored_alert) } it { is_expected.to contain_exactly(resolved_alert, ignored_alert) }
end end
context 'skips domain if iid is given' do
let(:params) { { iid: resolved_alert.iid, domain: 'threat_monitoring' } }
it { is_expected.to contain_exactly(resolved_alert) }
end
end end
context 'empty params' do context 'empty params' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment