From 9e70d5b935505497cf75dce8bb9843a7fa230c8e Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 26 Sep 2024 14:00:59 +0200 Subject: [PATCH] Add search to repository row selection [SCI-11106] --- app/controllers/repositories_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 4ec0abb03..853fe8cb9 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -52,7 +52,9 @@ class RepositoriesController < ApplicationController end def rows_list - render json: { data: @repository.repository_rows.map { |r| [r.id, r.name] } } + results = @repository.repository_rows + results = results.name_like(params[:query]) if params[:query].present? + render json: { data: results.map { |r| [r.id, r.name] } } end def sidebar