Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit e8be52f

Browse files
author
Volodymyr Kublytskyi
committed
ENGCOM-3095: [Backport] Fix HTTP Delete for Async operations #31
- Merge Pull Request magento/bulk-api-ce#31 from magento/bulk-api-ce:async-delete - Merged commits: 1. 069aa1c 2. 694d219
2 parents 840a7aa + 694d219 commit e8be52f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

app/code/Magento/WebapiAsync/Controller/Rest/Asynchronous/InputParamsResolver.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,14 @@ public function __construct(
8080

8181
/**
8282
* Process and resolve input parameters
83+
*
8384
* Return array with validated input params
8485
* or throw \Exception if at least one request entity params is not valid
8586
*
8687
* @return array
8788
* @throws \Magento\Framework\Exception\InputException if no value is provided for required parameters
8889
* @throws \Magento\Framework\Webapi\Exception
90+
* @throws \Magento\Framework\Exception\AuthorizationException
8991
*/
9092
public function resolve()
9193
{
@@ -95,6 +97,13 @@ public function resolve()
9597
$this->requestValidator->validate();
9698
$webapiResolvedParams = [];
9799
$inputData = $this->request->getRequestData();
100+
101+
$httpMethod = $this->request->getHttpMethod();
102+
if ($httpMethod == \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_DELETE) {
103+
$requestBodyParams = $this->request->getBodyParams();
104+
$inputData = array_merge($requestBodyParams, $inputData);
105+
}
106+
98107
foreach ($inputData as $key => $singleEntityParams) {
99108
$webapiResolvedParams[$key] = $this->resolveBulkItemParams($singleEntityParams);
100109
}
@@ -103,6 +112,8 @@ public function resolve()
103112
}
104113

105114
/**
115+
* Detect route by input parameters
116+
*
106117
* @return \Magento\Webapi\Controller\Rest\Router\Route
107118
*/
108119
public function getRoute()
@@ -111,9 +122,10 @@ public function getRoute()
111122
}
112123

113124
/**
125+
* Resolve parameters for service
126+
*
114127
* Convert the input array from key-value format to a list of parameters
115128
* suitable for the specified class / method.
116-
*
117129
* Instead of \Magento\Webapi\Controller\Rest\InputParamsResolver
118130
* we don't need to merge body params with url params and use only body params
119131
*

0 commit comments

Comments
 (0)