[API] add customer denormalization context to avoid errors when getting user

This commit is contained in:
SirDomin 2021-08-03 13:33:39 +02:00
parent 985e4b8661
commit 75b8959f48
No known key found for this signature in database
GPG key ID: D74943926397267A
3 changed files with 11 additions and 2 deletions

View file

@ -72,10 +72,10 @@
<attribute name="method">PUT</attribute>
<attribute name="path">/shop/customers/{id}</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:customer:read</attribute>
<attribute name="groups">shop:customer:update</attribute>
</attribute>
<attribute name="denormalization_context">
<attribute name="groups">shop:customer:update</attribute>
<attribute name="groups">shop:customer:denormalize</attribute>
</attribute>
</itemOperation>
</itemOperations>

View file

@ -24,38 +24,46 @@
<group>admin:customer:read</group>
<group>shop:customer:read</group>
<group>shop:customer:update</group>
<group>shop:customer:denormalize</group>
</attribute>
<attribute name="firstName">
<group>admin:customer:read</group>
<group>shop:customer:read</group>
<group>shop:customer:update</group>
<group>shop:customer:denormalize</group>
</attribute>
<attribute name="lastName">
<group>admin:customer:read</group>
<group>shop:customer:read</group>
<group>shop:customer:update</group>
<group>shop:customer:denormalize</group>
</attribute>
<attribute name="fullName">
<group>admin:customer:read</group>
<group>shop:customer:read</group>
<group>shop:customer:update</group>
<group>shop:customer:denormalize</group>
</attribute>
<attribute name="defaultAddress">
<group>admin:customer:read</group>
<group>shop:customer:read</group>
<group>shop:customer:update</group>
<group>shop:customer:denormalize</group>
</attribute>
<attribute name="subscribedToNewsletter">
<group>shop:customer:read</group>
<group>shop:customer:update</group>
<group>shop:customer:denormalize</group>
</attribute>
<attribute name="user">
<group>shop:customer:read</group>
<group>shop:customer:update</group>
</attribute>
</class>
</serializer>

View file

@ -18,6 +18,7 @@
<class name="Sylius\Component\Core\Model\ShopUser">
<attribute name="verified">
<group>shop:customer:read</group>
<group>shop:customer:update</group>
</attribute>
</class>
</serializer>