You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the birthday property is omitted (or not set) on a PUT request to the /me endpoint, the birthday of the current customer is set to the current date.
This looks like a bug. Besides the fact that the request class doesn't return a datetime immutable anyways. This looks like a missing typecheck on the command.
This PR was merged into the 1.0-dev branch.
Discussion
----------
Fixes#544
Fixing the customer birthday
Commits
-------
f010636 Fixing the customer birthday
aebff63 Moving DatetimeCreation to request class
When the
birthday
property is omitted (or not set) on a PUT request to the/me
endpoint, the birthday of the current customer is set to the current date.The
UpdateCustomerRequest
class declares thebirthday
class-property as nullable, therefore I assume that it should be possible to omit thebirthday
property from this request (eg. if the customer does not want to specify his birthday).https://github.com/Sylius/ShopApiPlugin/blob/master/src/Request/Customer/UpdateCustomerRequest.php#L25
This behaviour happens because the
UpdateCustomerHandler
constructs a newDateTimeImmutable
object with thebirthday
property of theUpdateCustomerRequest
. If this property is null, the constructedDateTimeImmutable
object will contain the current date.https://github.com/Sylius/ShopApiPlugin/blob/master/src/Handler/Customer/UpdateCustomerHandler.php#L31
The text was updated successfully, but these errors were encountered: