Sylius / ShopApiPlugin

Shop API for Sylius.
https://sylius.com
130 stars 89 forks source link

[Address] Handle adress exists validation in case when address does not belong to any customer #706

Closed hurricane-voronin closed 3 years ago

hurricane-voronin commented 3 years ago

Hi there, I've got an error during validation of address existence in case when it does not belong to any customer: see AddressExistsValidator

if ($address->getCustomer()->getEmail() !== $user->getEmail()) {
    return $this->context->addViolation($constraint->message);
}
mamazu commented 3 years ago

Hey, thanks for your contribution. This looks like an issue that should be fixed. Would you mind, to add tests for you new behaviour?

diimpp commented 3 years ago

Fixes https://github.com/Sylius/ShopApiPlugin/issues/705

mamazu commented 3 years ago

I have pushed tests to this branch and it is ready to be merged.

lchrusciel commented 3 years ago

Thanks, Denys! :1st_place_medal: