- if notice
- redirect_to issues_path, notice: notice
- end
-
- else
- @issues = Issue.where(issue_type: @user_role).order(:status)
+ if params[:status] and !params[:status][0].blank?
+ @issues = @issues.where(status: params[:status][0].to_i)
+ end
+
+ if params[:issue_type] and !params[:issue_type][0].blank?
+ @issues = @issues.where(reportable_type: params[:issue_type][0])
+ end
+
+ if @issues.first == nil
+ notice = t('issues.index.search.issues_not_found')
+ end
+
+ if params[:last_reported_by] and !params[:last_reported_by][0].blank?
+ last_reported_by = params[:last_reported_by][0].to_s == "nil" ? nil : params[:last_reported_by][0].to_i
+ @issues = @issues.where(updated_by: last_reported_by)