Check index filters
Some checks failed
/ Run tests (push) Successful in 2m24s
/ Run system tests (push) Has been cancelled
/ Build, push and deploy image (push) Has been cancelled

This commit is contained in:
david 2024-09-12 00:50:38 +02:00
parent 338447763f
commit bf52112e5c
6 changed files with 58 additions and 25 deletions

View file

@ -5,11 +5,7 @@ class ChecksController < ApplicationController
# GET /checks or /checks.json
def index
@pagy, @checks = if filter_params[:s]
pagy(Check.search(filter_params[:s]).order(:conformity_level))
else
pagy(Check.all.order(:conformity_level))
end
@pagy, @checks = pagy(Check.filter_by(filter_params).order(:conformity_level))
end
# GET /checks/1 or /checks/1.json
@ -71,7 +67,7 @@ class ChecksController < ApplicationController
end
def filter_params
@filter_params ||= params.permit(filter: %i[s level])[:filter] || {}
@filter_params ||= params.permit(filter: [ :s, priority: [], conformity_level: [], standard_ids: [], principle_id: [] ])[:filter] || {}
end
private