fix again the job type dropdown on jobqueue

This commit is contained in:
Oliver Gorwits
2023-10-24 20:05:35 +01:00
parent ae3ad986f7
commit 64313ed85a

View File

@@ -66,14 +66,19 @@ ajax '/ajax/data/queue/typeahead/action' => require_role admin => sub {
push @actions, lc $1; push @actions, lc $1;
} }
my $q = quotemeta( param('query') || param('term') || param('action') );
push @actions, push @actions,
grep { $q ? m/^$q/ : true }
grep { defined }
schema(vars->{'tenant'})->resultset('Admin')->get_distinct_col('action'); schema(vars->{'tenant'})->resultset('Admin')->get_distinct_col('action');
my $q = quotemeta( param('query') || param('term') || param('action') );
content_type 'application/json'; content_type 'application/json';
to_json [ List::MoreUtils::uniq sort @actions ]; to_json [
grep { $q ? m/^$q/ : true }
grep { defined }
List::MoreUtils::uniq
sort
@actions
];
}; };
ajax '/ajax/data/queue/typeahead/status' => require_role admin => sub { ajax '/ajax/data/queue/typeahead/status' => require_role admin => sub {