From 5cff02a403a608775b3d7d93c4d1276c4b33631e Mon Sep 17 00:00:00 2001 From: Sebastin Santy Date: Thu, 22 Jun 2017 01:31:16 +0530 Subject: Bug 1365344 - Extract the "status" and "null" modules (#101) * Added comp_desc, ajax loading, modified rest * Make summary field long * Fixed indentations --- extensions/BugModal/lib/WebService.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'extensions/BugModal/lib/WebService.pm') diff --git a/extensions/BugModal/lib/WebService.pm b/extensions/BugModal/lib/WebService.pm index a7026288c..556a2d7cc 100644 --- a/extensions/BugModal/lib/WebService.pm +++ b/extensions/BugModal/lib/WebService.pm @@ -96,9 +96,10 @@ sub components { ThrowCodeError( 'params_required', { function => 'BugModal.components', params => ['product'] } ); } - my $product = Bugzilla::Product->check( { name => $params->{product_name}, cache => 1 } ); - $product = Bugzilla->user->can_enter_product( $product, 1 ); - return { components => _name( $product->components ) }; + my $product = Bugzilla::Product->check({ name => $params->{product_name}, cache => 1 }); + $product = Bugzilla->user->can_enter_product($product, 1); + my @components = map { { name => $_->name, description => Bugzilla::Component->check({ product => $product, name => $_->name })->description} } @{ $product->components }; + return { components => \@components } } # everything we need for edit mode in a single call, returning just the fields -- cgit v1.2.3-24-g4f1b