Skip to content

Commit 90831f5

Browse files
author
vitaliyboyko
committed
graphQl: removed not needed exception, added test coverage
1 parent 0a6c0b5 commit 90831f5

File tree

2 files changed

+425
-8
lines changed

2 files changed

+425
-8
lines changed

app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressOnCart.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,12 @@ public function setAddresses(ContextInterface $context, int $cartId, array $ship
8484
if ((!$context->getUserId()) || $context->getUserType() == UserContextInterface::USER_TYPE_GUEST) {
8585
throw new GraphQlAuthorizationException(
8686
__(
87-
'Address management allowed only for authorized customers'
87+
'Address management allowed only for authorized customers.'
8888
)
8989
);
9090
}
9191
/** @var AddressInterface $customerAddress */
9292
$customerAddress = $this->addressRepository->getById($customerAddressId);
93-
if ($context->getUserId() !== (int)$customerAddress->getCustomerId()) {
94-
throw new GraphQlInputException(
95-
__(
96-
'Address is not applicable for current customer'
97-
)
98-
);
99-
}
10093
$shippingAddress = $this->addressModel->importCustomerAddressData($customerAddress);
10194
} else {
10295
$shippingAddress = $this->addressModel->addData($addressInput);

0 commit comments

Comments
 (0)