mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +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',
|
||||
'roles' => [
|
||||
Request::METHOD_POST => true, //TODO
|
||||
Request::METHOD_DELETE => true //TODO
|
||||
Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE,
|
||||
Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE
|
||||
]
|
||||
],
|
||||
]
|
||||
|
@ -24,7 +24,7 @@ class Household
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
* @Serializer\Groups({"read"})
|
||||
* @Serializer\Groups({"write"})
|
||||
*/
|
||||
private ?int $id = null;
|
||||
|
||||
@ -36,6 +36,7 @@ class Household
|
||||
* cascade={"persist", "remove", "merge", "detach"})
|
||||
* @ORM\JoinTable(name="chill_person_household_to_addresses")
|
||||
* @ORM\OrderBy({"validFrom" = "DESC"})
|
||||
* @Serializer\Groups({"write"})
|
||||
*/
|
||||
private Collection $addresses;
|
||||
|
||||
@ -44,7 +45,7 @@ class Household
|
||||
* targetEntity=HouseholdMember::class,
|
||||
* mappedBy="household"
|
||||
* )
|
||||
* @Serializer\Groups({"read"})
|
||||
* @Serializer\Groups({"write"})
|
||||
*/
|
||||
private Collection $members;
|
||||
|
||||
|
@ -9,7 +9,7 @@ export const postAddressToHousehold = (householdId, addressId) => {
|
||||
console.log(householdId);
|
||||
console.log(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, {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json;charset=utf-8'},
|
||||
|
Loading…
x
Reference in New Issue
Block a user