Skip to content

Commit

Permalink
Merge pull request magento#1288 from magento-engcom/issue-1039-incorr…
Browse files Browse the repository at this point in the history
…ect-web-api-delete-implementation

Issue 1039 incorrect web api delete implementation
  • Loading branch information
Valeriy Nayda authored Jun 12, 2018
2 parents ccff0cc + bc175c8 commit d3d51c3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class SourceItemsDeleteTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_DELETE_PATH = '/V1/inventory/source-items-delete';
const RESOURCE_PATH = '/V1/inventory/source-item';
const SERVICE_NAME = 'inventoryApiSourceItemsDeleteV1';
/**#@-*/
Expand Down Expand Up @@ -56,9 +57,9 @@ public function testExecute()

$serviceInfo = [
'rest' => [
'resourcePath' => self::RESOURCE_PATH . '?'
'resourcePath' => self::RESOURCE_DELETE_PATH . '?'
. http_build_query(['sourceItems' => $sourceItemsForDelete]),
'httpMethod' => Request::HTTP_METHOD_DELETE,
'httpMethod' => Request::HTTP_METHOD_POST,
],
'soap' => [
'service' => self::SERVICE_NAME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class StockSourceLinksDeleteTest extends WebapiAbstract
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/stock-source-link';
const RESOURCE_DELETE_PATH = '/V1/inventory/stock-source-links-delete';
const SERVICE_NAME_SAVE = 'inventoryApiStockSourceLinksSaveV1';
const SERVICE_NAME_DELETE = 'inventoryApiStockSourceLinksDeleteV1';
const SERVICE_NAME_GET_LIST = 'inventoryApiGetStockSourceLinksV1';
Expand Down Expand Up @@ -54,9 +55,9 @@ public function testExecute()

$serviceInfo = [
'rest' => [
'resourcePath' => self::RESOURCE_PATH . '?'
'resourcePath' => self::RESOURCE_DELETE_PATH . '?'
. http_build_query(['links' => $linksForDelete]),
'httpMethod' => Request::HTTP_METHOD_DELETE,
'httpMethod' => Request::HTTP_METHOD_POST,
],
'soap' => [
'service' => self::SERVICE_NAME_DELETE,
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/InventoryApi/etc/webapi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<resource ref="Magento_InventoryApi::stock_source_link"/>
</resources>
</route>
<route url="/V1/inventory/stock-source-link" method="DELETE">
<route url="/V1/inventory/stock-source-links-delete" method="POST">
<service class="Magento\InventoryApi\Api\StockSourceLinksDeleteInterface" method="execute"/>
<resources>
<resource ref="Magento_InventoryApi::stock_source_link"/>
Expand All @@ -107,7 +107,7 @@
<resource ref="Magento_InventoryApi::source"/>
</resources>
</route>
<route url="/V1/inventory/source-item" method="DELETE">
<route url="/V1/inventory/source-items-delete" method="POST">
<service class="Magento\InventoryApi\Api\SourceItemsDeleteInterface" method="execute"/>
<resources>
<resource ref="Magento_InventoryApi::source"/>
Expand Down

0 comments on commit d3d51c3

Please sign in to comment.