add isCoach getter

This commit is contained in:
Andreas Zweili 2021-06-29 22:10:43 +02:00
parent bdc654c30a
commit aece4bba6a
1 changed files with 5 additions and 0 deletions

View File

@ -4,5 +4,10 @@ export default {
},
hasCoaches(state) {
return state.coaches && state.coaches.length > 0;
},
isCoach(_, getters, _2, rootGetters) {
const coaches = getters.coaches;
const userId = rootGetters.userId;
return coaches.some(coach => coach.id === userId);
}
};