mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
household address: api POST on address for household (WIP)
This commit is contained in:
parent
5ee824d1c2
commit
6c126b0581
@ -544,8 +544,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
],
|
],
|
||||||
'controller_action' => 'householdAddressApi',
|
'controller_action' => 'householdAddressApi',
|
||||||
'roles' => [
|
'roles' => [
|
||||||
Request::METHOD_POST => true, //TODO
|
Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE,
|
||||||
Request::METHOD_DELETE => true //TODO
|
Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
|
@ -24,7 +24,7 @@ class Household
|
|||||||
* @ORM\Id
|
* @ORM\Id
|
||||||
* @ORM\GeneratedValue
|
* @ORM\GeneratedValue
|
||||||
* @ORM\Column(type="integer")
|
* @ORM\Column(type="integer")
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"write"})
|
||||||
*/
|
*/
|
||||||
private ?int $id = null;
|
private ?int $id = null;
|
||||||
|
|
||||||
@ -36,6 +36,7 @@ class Household
|
|||||||
* cascade={"persist", "remove", "merge", "detach"})
|
* cascade={"persist", "remove", "merge", "detach"})
|
||||||
* @ORM\JoinTable(name="chill_person_household_to_addresses")
|
* @ORM\JoinTable(name="chill_person_household_to_addresses")
|
||||||
* @ORM\OrderBy({"validFrom" = "DESC"})
|
* @ORM\OrderBy({"validFrom" = "DESC"})
|
||||||
|
* @Serializer\Groups({"write"})
|
||||||
*/
|
*/
|
||||||
private Collection $addresses;
|
private Collection $addresses;
|
||||||
|
|
||||||
@ -44,7 +45,7 @@ class Household
|
|||||||
* targetEntity=HouseholdMember::class,
|
* targetEntity=HouseholdMember::class,
|
||||||
* mappedBy="household"
|
* mappedBy="household"
|
||||||
* )
|
* )
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"write"})
|
||||||
*/
|
*/
|
||||||
private Collection $members;
|
private Collection $members;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ export const postAddressToHousehold = (householdId, addressId) => {
|
|||||||
console.log(householdId);
|
console.log(householdId);
|
||||||
console.log(addressId);
|
console.log(addressId);
|
||||||
const body = {'address': addressId};
|
const body = {'address': addressId};
|
||||||
const url = `/api/1.0/person/household/${householdId}.json`
|
const url = `/api/1.0/person/household/${householdId}/address.json`
|
||||||
return fetch(url, {
|
return fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {'Content-Type': 'application/json;charset=utf-8'},
|
headers: {'Content-Type': 'application/json;charset=utf-8'},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user