diff options
author | Noah Loomans <noahloomans@gmail.com> | 2018-02-19 22:59:35 +0100 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2018-02-19 22:59:35 +0100 |
commit | df1af158484b25c2a250c3ff3b3c72df2c562bb3 (patch) | |
tree | fcec0395a18b89e9da6b7697b87f1cc8d1ec3a74 /src/client/react/lib | |
parent | 5be066cc2714ca6cbd75d8786c859d8767df0ccb (diff) |
Simplify schedule state
Diffstat (limited to 'src/client/react/lib')
-rw-r--r-- | src/client/react/lib/extractSchedule.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/client/react/lib/extractSchedule.js b/src/client/react/lib/extractSchedule.js index 97589f8..6f30970 100644 --- a/src/client/react/lib/extractSchedule.js +++ b/src/client/react/lib/extractSchedule.js @@ -19,12 +19,11 @@ */ export default function extractSchedule(schedules, user, week) { - const scheduleExists = - schedules.hasOwnProperty(user) && schedules[user].hasOwnProperty(week); + const scheduleExists = schedules.hasOwnProperty(`${user}:${week}`); if (!scheduleExists) { return { state: 'NOT_REQUESTED' }; } - return schedules[user][week]; + return schedules[`${user}:${week}`]; } |