Class: Kaui::QueuesController
- Inherits:
-
EngineController
- Object
- EngineController
- Kaui::QueuesController
- Defined in:
- app/controllers/kaui/queues_controller.rb
Instance Method Summary collapse
-
#index ⇒ Object
rubocop:disable Lint/SuppressedException,Lint/EnsureReturn.
Instance Method Details
#index ⇒ Object
rubocop:disable Lint/SuppressedException,Lint/EnsureReturn
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'app/controllers/kaui/queues_controller.rb', line 6 def index @account_id = params[:account_id] if params[:max_date].present? begin max_date_test = Time.parse(params[:max_date]).iso8601 rescue StandardError ensure if max_date_test.nil? flash[:error] = I18n.t('errors.messages.invalid_max_date') redirect_to account_queues_path(@account.account_id) and return end end end if params[:min_date].present? begin min_date_test = Time.parse(params[:min_date]).iso8601 rescue StandardError ensure if min_date_test.nil? flash[:error] = I18n.t('errors.messages.invalid_min_date') redirect_to account_queues_path(@account.account_id) and return end end end begin @now = Kaui::Admin.get_clock(nil, )['currentUtcTime'].to_datetime rescue KillBillClient::API::NotFound # If TestResource is not bound, then clock has not been manipulated, we can default to NOW @now = DateTime.now.in_time_zone('UTC') end min_date = (Time.parse(params[:min_date]).iso8601 if params[:min_date].present?) || '1970-01-01' max_date = (Time.parse(params[:max_date]).iso8601 if params[:max_date].present?) || Time.now.iso8601 with_history = params[:with_history] || false @queues_entries = Kaui::Admin.get_queues_entries(@account_id, .merge(withHistory: with_history, minDate: min_date, maxDate: max_date)) params.permit! end |