Fix issue with turning quote_names on with case insensitive search
This commit is contained in:
parent
74d69e708a
commit
b44cb5fe1d
2 changed files with 5 additions and 2 deletions
|
@ -14,6 +14,7 @@ has schema => sub {
|
|||
$c->app->config->{dsn},
|
||||
$c->app->config->{user},
|
||||
$c->app->config->{pass},
|
||||
{ quote_names => 1 },
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -172,12 +172,14 @@ sub post_search {
|
|||
|
||||
my $search_name = $validation->param('search_name');
|
||||
|
||||
my $search_stmt = [ 'LOWER("name") LIKE ?', '%' . lc $search_name . '%' ];
|
||||
|
||||
my $valid_orgs_rs = $c->schema->resultset('Organisation')->search(
|
||||
{ 'LOWER(name)' => { -like => '%' . lc $search_name . '%' } },
|
||||
\$search_stmt,
|
||||
);
|
||||
|
||||
my $pending_orgs_rs = $c->stash->{api_user}->pending_organisations->search(
|
||||
{ 'LOWER(name)' => { -like => '%' . lc $search_name . '%' } },
|
||||
\$search_stmt,
|
||||
);
|
||||
|
||||
my @valid_orgs = (
|
||||
|
|
Reference in a new issue