fix error on previous commit, when creating new accourse

This commit is contained in:
Mathieu Jaumotte 2021-09-27 13:14:42 +02:00
parent eb89fa2cd4
commit 5da332a06e

View File

@ -135,12 +135,17 @@ export default {
return this.accompanyingCourse.participations.filter(p => p.enddate !== null); return this.accompanyingCourse.participations.filter(p => p.enddate !== null);
}, },
hasNoPersonLocation() { hasNoPersonLocation() {
let addressInParticipations_ = [] let addressInParticipations_ = []
this.currentParticipations.forEach(p => { this.currentParticipations.forEach(p => {
addressInParticipations_.push(this.checkHouseholdAddressForParticipation(p)); addressInParticipations_.push(this.checkHouseholdAddressForParticipation(p));
}); });
const booleanReducer = (previousValue, currentValue) => previousValue || currentValue; const booleanReducer = (previousValue, currentValue) => previousValue || currentValue;
let addressInParticipations = addressInParticipations_.reduce(booleanReducer);
let addressInParticipations = (addressInParticipations_.length > 0) ?
addressInParticipations_.reduce(booleanReducer) : false;
//console.log(addressInParticipations_, addressInParticipations); //console.log(addressInParticipations_, addressInParticipations);
return ( return (
this.accompanyingCourse.step !== 'DRAFT' this.accompanyingCourse.step !== 'DRAFT'