diff options
author | Byron Jones <glob@mozilla.com> | 2015-04-17 06:56:18 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-04-17 06:56:18 +0200 |
commit | 09de3de190a692dfbc2533ceee8f31648905b91a (patch) | |
tree | b551eb1643bf54f614b3810b0c84bec90d0b411b /extensions/ProdCompSearch/lib/WebService.pm | |
parent | e9bfbbb9c07d902499bb0901a0cd67fe9279bf3b (diff) | |
download | bugzilla-09de3de190a692dfbc2533ceee8f31648905b91a.tar.gz bugzilla-09de3de190a692dfbc2533ceee8f31648905b91a.tar.xz |
Bug 1154730: rewrite product/component searching to use jquery-ui instead of yui
Diffstat (limited to 'extensions/ProdCompSearch/lib/WebService.pm')
-rw-r--r-- | extensions/ProdCompSearch/lib/WebService.pm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/extensions/ProdCompSearch/lib/WebService.pm b/extensions/ProdCompSearch/lib/WebService.pm index b9a03eb27..3bf0e1377 100644 --- a/extensions/ProdCompSearch/lib/WebService.pm +++ b/extensions/ProdCompSearch/lib/WebService.pm @@ -15,10 +15,31 @@ use base qw(Bugzilla::WebService); use Bugzilla::Error; use Bugzilla::Util qw(detaint_natural trick_taint trim); +############# +# Constants # +############# + use constant PUBLIC_METHODS => qw( prod_comp_search ); +sub rest_resources { + return [ + qr{^/prod_comp_search/(.*)$}, { + GET => { + method => 'prod_comp_search', + params => sub { + return { search => $_[0] } + } + } + } + ] +} + +################## +# Public Methods # +################## + sub prod_comp_search { my ($self, $params) = @_; my $user = Bugzilla->user; @@ -104,6 +125,10 @@ sub prod_comp_search { return { products => $products }; } +################### +# Private Methods # +################### + sub _build_terms { my ($query, $product, $component) = @_; my $dbh = Bugzilla->dbh(); |