diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue index fd705d374..915edfc8e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue @@ -133,6 +133,17 @@ +
+ +
+
[ + ...state.accompanyingCourse.participations.map(p => p.person), + ...state.accompanyingCourse.resources.map(r => r.resource) + ] + .filter((e) => e !== null) + }), accompanyingCourse() { return this.$store.state.accompanyingCourse }, @@ -227,6 +246,19 @@ export default { this.$toast.open({message: 'An error occurred'}) } }); + }, + addSuggestedEntity(e) { + this.$store.dispatch('addRequestor', { result: e, type: e.type }) //TODO check person | thirdparty + .catch(({name, violations}) => { + if (name === 'ValidationException' || name === 'AccessException') { + violations.forEach((violation) => this.$toast.open({message: violation})); + } else { + this.$toast.open({message: 'An error occurred'}) + } + }) + }, + uniqueId(e) { + return `${e.type}-${e.id}`; } } }