add isCoach getter
This commit is contained in:
parent
bdc654c30a
commit
aece4bba6a
|
@ -4,5 +4,10 @@ export default {
|
||||||
},
|
},
|
||||||
hasCoaches(state) {
|
hasCoaches(state) {
|
||||||
return state.coaches && state.coaches.length > 0;
|
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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Reference in New Issue