diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2013-07-23 22:24:59 +0200 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2013-07-23 22:24:59 +0200 |
commit | b799069b85c17aafb7897b9124a7bb6e494d73fc (patch) | |
tree | c4d939c8c074216926be72dab84a1d0c1739c5b1 /Bugzilla/WebService/Server | |
parent | 927f0c3a1f719d83ae959c715e1a26e562e6aacb (diff) | |
download | bugzilla-b799069b85c17aafb7897b9124a7bb6e494d73fc.tar.gz bugzilla-b799069b85c17aafb7897b9124a7bb6e494d73fc.tar.xz |
Bug 896066 - Allow REST WebService API to for GET /product to allow retrieval of multiple product objects
r/a=glob
Diffstat (limited to 'Bugzilla/WebService/Server')
-rw-r--r-- | Bugzilla/WebService/Server/REST/Resources/Product.pm | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/Bugzilla/WebService/Server/REST/Resources/Product.pm b/Bugzilla/WebService/Server/REST/Resources/Product.pm index 1949282e9..acee3887b 100644 --- a/Bugzilla/WebService/Server/REST/Resources/Product.pm +++ b/Bugzilla/WebService/Server/REST/Resources/Product.pm @@ -21,17 +21,24 @@ BEGIN { sub _rest_resources { my $rest_resources = [ + qr{^/product_accessible$}, { + GET => { + method => 'get_accessible_products' + } + }, + qr{^/product_enterable$}, { + GET => { + method => 'get_enterable_products' + } + }, + qr{^/product_selectable$}, { + GET => { + method => 'get_selectable_products' + } + }, qr{^/product$}, { GET => { - method => sub { - my $type = Bugzilla->input_params->{type}; - return 'get_accessible_products' - if !defined $type || $type eq 'accessible'; - return 'get_enterable_products' if $type eq 'enterable'; - return 'get_selectable_products' if $type eq 'selectable'; - ThrowUserError('rest_get_products_invalid_type', - { type => $type }); - }, + method => 'get' }, POST => { method => 'create', |