From e5ebce2b90812b88e5f3c8a5b7b7249ac70df9e7 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Tue, 23 Jul 2013 16:35:06 -0400 Subject: Bug 897093 - Port the upstream Product.get webservice changes (bug 896066) to bmo/4.2 --- .../WebService/Server/REST/Resources/Product.pm | 25 ++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'Bugzilla/WebService/Server/REST') 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', -- cgit v1.2.3-24-g4f1b