From 5db53c9ecf6270bd8ea6092c0893e96703f6ad61 Mon Sep 17 00:00:00 2001 From: Simon Green Date: Sun, 7 Dec 2014 07:48:33 +1000 Subject: Bug 1052202 - Web Service module to update and delete components r=dylan, a=glob --- .../WebService/Server/REST/Resources/Component.pm | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'Bugzilla/WebService/Server/REST/Resources/Component.pm') 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; } -- cgit v1.2.3-24-g4f1b