Skip to content

Commit e026cfb

Browse files
committed
MC-34298: Introduce separate POST and PUT API for carts/mine/items
1 parent 85d0dd6 commit e026cfb

File tree

3 files changed

+14
-24
lines changed

3 files changed

+14
-24
lines changed

app/code/Magento/Quote/Api/AddCartItemInterface.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77

88
namespace Magento\Quote\Api;
99

10-
use Magento\Framework\Exception\CouldNotSaveException;
11-
use Magento\Framework\Exception\InputException;
12-
use Magento\Framework\Exception\NoSuchEntityException;
13-
use Magento\Quote\Api\Data\CartItemInterface;
14-
1510
/**
1611
* Interface AddCartItemInterface
1712
* @api
@@ -21,11 +16,11 @@ interface AddCartItemInterface
2116
/**
2217
* Add the specified cart item.
2318
*
24-
* @param CartItemInterface $cartItem The item.
25-
* @return CartItemInterface
26-
* @throws NoSuchEntityException The specified cart does not exist.
27-
* @throws CouldNotSaveException The specified item could not be saved to the cart.
28-
* @throws InputException The specified item or cart is not valid.
19+
* @param \Magento\Quote\Api\Data\CartItemInterface $cartItem The item.
20+
* @return \Magento\Quote\Api\Data\CartItemInterface Item.
21+
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
22+
* @throws \Magento\Framework\Exception\CouldNotSaveException The specified item could not be saved to the cart.
23+
* @throws \Magento\Framework\Exception\InputException The specified item or cart is not valid.
2924
*/
30-
public function execute(CartItemInterface $cartItem);
25+
public function execute(\Magento\Quote\Api\Data\CartItemInterface $cartItem);
3126
}

app/code/Magento/Quote/Api/UpdateCartItemInterface.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77

88
namespace Magento\Quote\Api;
99

10-
use Magento\Framework\Exception\CouldNotSaveException;
11-
use Magento\Framework\Exception\InputException;
12-
use Magento\Framework\Exception\NoSuchEntityException;
13-
use Magento\Quote\Api\Data\CartItemInterface;
14-
1510
/**
1611
* Interface AddCartItemInterface
1712
* @api
@@ -21,11 +16,11 @@ interface UpdateCartItemInterface
2116
/**
2217
* Update the specified cart item.
2318
*
24-
* @param CartItemInterface $cartItem The item.
25-
* @return CartItemInterface Item.
26-
* @throws NoSuchEntityException The specified cart does not exist.
27-
* @throws CouldNotSaveException The specified item could not be saved to the cart.
28-
* @throws InputException The specified item or cart is not valid.
19+
* @param \Magento\Quote\Api\Data\CartItemInterface $cartItem The item.
20+
* @return \Magento\Quote\Api\Data\CartItemInterface Item.
21+
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
22+
* @throws \Magento\Framework\Exception\CouldNotSaveException The specified item could not be saved to the cart.
23+
* @throws \Magento\Framework\Exception\InputException The specified item or cart is not valid.
2924
*/
30-
public function execute(CartItemInterface $cartItem);
25+
public function execute(\Magento\Quote\Api\Data\CartItemInterface $cartItem);
3126
}

app/code/Magento/Quote/Model/Quote/Item/UpdateCartItem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
namespace Magento\Quote\Model\Quote\Item;
99

10-
use Magento\Quote\Api\AddCartItemInterface;
1110
use Magento\Quote\Api\Data\CartItemInterface;
11+
use Magento\Quote\Api\UpdateCartItemInterface;
1212

1313
/**
1414
* Update the specified cart item
1515
*/
16-
class UpdateCartItem implements AddCartItemInterface
16+
class UpdateCartItem implements UpdateCartItemInterface
1717
{
1818
/**
1919
* @var Repository

0 commit comments

Comments
 (0)