summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService/Server/REST/Resources/Component.pm
diff options
context:
space:
mode:
authorSimon Green <simon@simongreen.net>2014-12-06 22:48:33 +0100
committerSimon Green <sgreen@redhat.com>2014-12-06 22:48:33 +0100
commit5db53c9ecf6270bd8ea6092c0893e96703f6ad61 (patch)
tree4e8330e4cf7f496721a137409c0a9af499ec90b8 /Bugzilla/WebService/Server/REST/Resources/Component.pm
parent9d1dc1f24d6a43339ed00e8899cf579d2739401b (diff)
downloadbugzilla-5db53c9ecf6270bd8ea6092c0893e96703f6ad61.tar.gz
bugzilla-5db53c9ecf6270bd8ea6092c0893e96703f6ad61.tar.xz
Bug 1052202 - Web Service module to update and delete components
r=dylan, a=glob
Diffstat (limited to 'Bugzilla/WebService/Server/REST/Resources/Component.pm')
-rw-r--r--Bugzilla/WebService/Server/REST/Resources/Component.pm28
1 files changed, 28 insertions, 0 deletions
diff --git a/Bugzilla/WebService/Server/REST/Resources/Component.pm b/Bugzilla/WebService/Server/REST/Resources/Component.pm
index 198c09332..47a8b9e0f 100644
--- a/Bugzilla/WebService/Server/REST/Resources/Component.pm
+++ b/Bugzilla/WebService/Server/REST/Resources/Component.pm
@@ -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;
}