Commit 5db53c9e authored by Simon Green's avatar Simon Green Committed by Simon Green

Bug 1052202 - Web Service module to update and delete components

r=dylan, a=glob
parent 9d1dc1f2
......@@ -184,6 +184,7 @@ use constant WS_ERROR_CODE => {
product_must_have_description => 703,
product_must_have_version => 704,
product_must_define_defaultmilestone => 705,
product_admin_denied => 706,
# Group errors are 800-900
empty_group_name => 800,
......@@ -207,9 +208,13 @@ use constant WS_ERROR_CODE => {
flag_type_not_editable => 1105,
# Component errors are 1200-1300
component_already_exists => 1200,
component_is_last => 1201,
component_has_bugs => 1202,
component_already_exists => 1200,
component_is_last => 1201,
component_has_bugs => 1202,
component_blank_name => 1210,
component_blank_description => 1211,
multiple_components_update_not_allowed => 1212,
component_need_initialowner => 1213,
# Errors thrown by the WebService itself. The ones that are negative
# conform to http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php
......
......@@ -857,7 +857,7 @@ C<array> of C<int>s. Numeric ids of the products that you wish to update.
=item C<names>
C<array> or C<string>s. Names of the products that you wish to update.
C<array> of C<string>s. Names of the products that you wish to update.
=back
......
......@@ -28,6 +28,34 @@ sub _rest_resources {
success_code => STATUS_CREATED
}
},
qr{^/component/(\d+)$}, {
PUT => {
method => 'update',
params => sub {
return { ids => [ $_[0] ] };
}
},
DELETE => {
method => 'delete',
params => sub {
return { ids => [ $_[0] ] };
}
},
},
qr{^/component/([^/]+)/([^/]+)$}, {
PUT => {
method => 'update',
params => sub {
return { names => [ { product => $_[0], component => $_[1] } ] };
}
},
DELETE => {
method => 'delete',
params => sub {
return { names => [ { product => $_[0], component => $_[1] } ] };
}
},
},
];
return $rest_resources;
}
......
......@@ -1338,6 +1338,11 @@
You cannot set aliases when modifying multiple [% terms.bugs %]
at once.
[% ELSIF error == "multiple_components_update_not_allowed" %]
[% title = "Multiple Components Update Not allowed" %]
You can not update the name for multiple components of the
same product.
[% ELSIF error == "need_quip" %]
[% title = "Quip Required" %]
[% docslinks = {'quips.html' => 'About quips'} %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment