Skip to content

Commit

Permalink
remove productCode, mention in upgrade file
Browse files Browse the repository at this point in the history
  • Loading branch information
SirDomin committed Apr 28, 2021
1 parent 0661713 commit 090d1dd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 2 additions & 0 deletions UPGRADE-1.10.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@
1. We've removed `Sylius\Bundle\ApiBundle\ApiPlatform\Bridge\Doctrine\ORM\SubresourceDataProvider`. It's no longer needed because `ApiPlatform\Core\Bridge\Doctrine\Orm\SubresourceDataProvider` has the same logic.

1. API Change Quantity endpoint `PATCH api/v2/admin/orders/{tokenValue}/change-quantity` has been changed to `PATCH api/v2/admin/orders/{tokenValue}/items/{orderItemId}` and its body value `orderItemId` has been removed (now it is a route parameter) and `newQuantity` has been renamed to `quantity`.

1. API Add to cart endpoint `PATCH /api/v2/shop/orders/{tokenValue}/items` no longer requires `productCode` in request body.
1 change: 0 additions & 1 deletion src/Sylius/Behat/Context/Api/Shop/CartContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,6 @@ private function putProductToCart(ProductInterface $product, ?string $tokenValue
$request = Request::customItemAction('shop', 'orders', $tokenValue, HttpRequest::METHOD_PATCH, 'items');

$request->updateContent([
'productCode' => $product->getCode(),
'productVariantCode' => $this->productVariantResolver->getVariant($product)->getCode(),
'quantity' => $quantity,
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
xsi:schemaLocation="http://symfony.com/schema/dic/serializer-mapping https://symfony.com/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd"
>
<class name="Sylius\Bundle\ApiBundle\Command\Cart\AddItemToCart">
<attribute name="productCode">
<group>shop:cart:add_item</group>
</attribute>
<attribute name="productVariantCode">
<group>shop:cart:add_item</group>
</attribute>
Expand Down

0 comments on commit 090d1dd

Please sign in to comment.