diff --git a/src/store/modules/coaches/getters.js b/src/store/modules/coaches/getters.js index d2a75ec..f1738d7 100644 --- a/src/store/modules/coaches/getters.js +++ b/src/store/modules/coaches/getters.js @@ -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); } };