rdv: fix adding thirdparty when creating a rdv

This commit is contained in:
nobohan 2021-07-19 11:30:06 +02:00
parent 450025c145
commit b894596304
2 changed files with 14 additions and 10 deletions

View File

@ -2,10 +2,10 @@
namespace Chill\CalendarBundle\Entity; namespace Chill\CalendarBundle\Entity;
use Chill\CalendarBundle\Repository\CalendarRepository;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Symfony\Component\Serializer\Annotation\Groups;
use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\User;
use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person;
@ -15,6 +15,7 @@ use Chill\CalendarBundle\Entity\CancelReason;
use Chill\CalendarBundle\Entity\CalendarRange; use Chill\CalendarBundle\Entity\CalendarRange;
use Chill\CalendarBundle\Entity\Invite; use Chill\CalendarBundle\Entity\Invite;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\CalendarBundle\Repository\CalendarRepository;
/** /**
* @ORM\Table(name="chill_calendar.calendar") * @ORM\Table(name="chill_calendar.calendar")
@ -36,6 +37,7 @@ class Calendar
/** /**
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod") * @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod")
* @Groups({"read"})
*/ */
private AccompanyingPeriod $accompanyingPeriod; private AccompanyingPeriod $accompanyingPeriod;
@ -50,6 +52,7 @@ class Calendar
* targetEntity="Chill\PersonBundle\Entity\Person", * targetEntity="Chill\PersonBundle\Entity\Person",
* cascade={"persist", "remove", "merge", "detach"}) * cascade={"persist", "remove", "merge", "detach"})
* @ORM\JoinTable(name="chill_calendar.calendar_to_persons") * @ORM\JoinTable(name="chill_calendar.calendar_to_persons")
* @Groups({"read"})
*/ */
private Collection $persons; private Collection $persons;
@ -68,6 +71,7 @@ class Calendar
* targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty", * targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty",
* cascade={"persist", "remove", "merge", "detach"}) * cascade={"persist", "remove", "merge", "detach"})
* @ORM\JoinTable(name="chill_calendar.calendar_to_thirdparties") * @ORM\JoinTable(name="chill_calendar.calendar_to_thirdparties")
* @Groups({"read"})
*/ */
private Collection $professionals; private Collection $professionals;
@ -77,6 +81,7 @@ class Calendar
* targetEntity="Invite", * targetEntity="Invite",
* cascade={"persist", "remove", "merge", "detach"}) * cascade={"persist", "remove", "merge", "detach"})
* @ORM\JoinTable(name="chill_calendar.calendar_to_invites") * @ORM\JoinTable(name="chill_calendar.calendar_to_invites")
* @Groups({"read"})
*/ */
private Collection $invites; private Collection $invites;

View File

@ -17,19 +17,18 @@ const removeIdFromValue = (string, id) => {
return str; return str;
}; };
// const activity = { /*
// accompanyingPeriod: window.accompanyingPeriod, * Assign missing keys for the ConcernedGroups component
// persons: [], */
// thirdParties: [], const mapEntity = (entity) => {
// users: [] Object.assign(entity, {thirdParties: entity.professionals, users: entity.invites});
// }; // TODO: get this object from window.activity ? return entity;
};
console.log(window.entity)
const store = createStore({ const store = createStore({
strict: debug, strict: debug,
state: { state: {
activity: window.entity, activity: mapEntity(window.entity),
}, },
mutations: { mutations: {