diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index fbd10e723..549f800a2 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -282,7 +282,7 @@ class Activity implements HasCenterInterface, HasScopeInterface return $this->socialIssues; } - public function addSocialIssue(?SocialIssue $socialIssue): self + public function addSocialIssue(SocialIssue $socialIssue): self { if (!$this->socialIssues->contains($socialIssue)) { $this->socialIssues[] = $socialIssue; @@ -303,7 +303,7 @@ class Activity implements HasCenterInterface, HasScopeInterface return $this->socialActions; } - public function addSocialAction(?SocialAction $socialAction): self + public function addSocialAction(SocialAction $socialAction): self { if (!$this->socialActions->contains($socialAction)) { $this->socialActions[] = $socialAction; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue index 617c0e4dd..d06a4c001 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue @@ -5,6 +5,7 @@

{{ $t('course.title.draft') }}

{{ $t('course.title.active') }}

+ @@ -19,6 +20,7 @@ import { mapState } from 'vuex' import Banner from './components/Banner.vue'; import StickyNav from './components/StickyNav.vue'; +import OriginDemand from './components/OriginDemand.vue'; import PersonsAssociated from './components/PersonsAssociated.vue'; import Requestor from './components/Requestor.vue'; import SocialIssue from './components/SocialIssue.vue'; @@ -32,6 +34,7 @@ export default { components: { Banner, StickyNav, + OriginDemand, PersonsAssociated, Requestor, SocialIssue, diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js index 70b2ba56e..ada63846e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js @@ -98,7 +98,7 @@ const postParticipation = (id, payload, method) => { const postRequestor = (id, payload, method) => { //console.log('payload', payload); const body = (payload)? { type: payload.type, id: payload.id } : {}; - console.log('body', body); + //console.log('body', body); const url = `/api/1.0/person/accompanying-course/${id}/requestor.json`; return fetch(url, { method: method, @@ -131,7 +131,7 @@ const postResource = (id, payload, method) => { default: body['resource'] = { type: payload.type, id: payload.id }; } - console.log('body', body); + //console.log('body', body); const url = `/api/1.0/person/accompanying-course/${id}/resource.json`; return fetch(url, { method: method, @@ -165,6 +165,42 @@ const postSocialIssue = (id, body, method) => { }); }; +const getUsers = () => { + const url = `/api/1.0/main/user.json`; + return fetch(url) + .then(response => { + if (response.ok) { return response.json(); } + throw Error('Error with request resource response'); + }); +}; + +const whoami = () => { + const url = `/api/1.0/main/whoami.json`; + return fetch(url) + .then(response => { + if (response.ok) { return response.json(); } + throw Error('Error with request resource response'); + }); +}; + +const getListOrigins = () => { + const url = `/api/1.0/person/accompanying-period/origin.json`; + return fetch(url) + .then(response => { + if (response.ok) { return response.json(); } + throw Error('Error with request resource response'); + }); +} + +const getOrigin = (id) => { + const url = `/api/1.0/person/accompanying-period/origin/${id}.json`; + return fetch(url) + .then(response => { + if (response.ok) { return response.json(); } + throw Error('Error with request resource response'); + }); +} + export { getAccompanyingCourse, patchAccompanyingCourse, @@ -173,5 +209,9 @@ export { postParticipation, postRequestor, postResource, + getUsers, + whoami, + getListOrigins, + getOrigin, postSocialIssue }; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/OriginDemand.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/OriginDemand.vue new file mode 100644 index 000000000..8706601e2 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/OriginDemand.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Referrer.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Referrer.vue index b007bc17e..c566d2281 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Referrer.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Referrer.vue @@ -1,42 +1,43 @@