aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/lib/extractSchedule.js
blob: e74411be08255de24e08362c5516ec89f7093333 (plain)
1
2
3
4
5
6
7
8
9
10
export default function extractSchedule(schedules, user, week) {
  const scheduleExists =
    schedules.hasOwnProperty(user) && schedules[user].hasOwnProperty(week);

  if (!scheduleExists) {
    return { state: 'NOT_REQUESTED' };
  }

  return schedules[user][week];
}