From 5da332a06ee59213e2bb2f4ff1a7207eaaaaba00 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 27 Sep 2021 13:14:42 +0200 Subject: [PATCH] fix error on previous commit, when creating new accourse --- .../vuejs/AccompanyingCourse/components/CourseLocation.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue index 3e6b40c28..7ae25b25c 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue @@ -135,12 +135,17 @@ export default { return this.accompanyingCourse.participations.filter(p => p.enddate !== null); }, hasNoPersonLocation() { + let addressInParticipations_ = [] this.currentParticipations.forEach(p => { addressInParticipations_.push(this.checkHouseholdAddressForParticipation(p)); }); + const booleanReducer = (previousValue, currentValue) => previousValue || currentValue; - let addressInParticipations = addressInParticipations_.reduce(booleanReducer); + + let addressInParticipations = (addressInParticipations_.length > 0) ? + addressInParticipations_.reduce(booleanReducer) : false; + //console.log(addressInParticipations_, addressInParticipations); return ( this.accompanyingCourse.step !== 'DRAFT'