aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/actions/view.js
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-01-28 15:43:11 +0100
committerNoah Loomans <noahloomans@gmail.com>2018-01-28 15:43:11 +0100
commit8670ada517bc8beb69d152c82f282322b9ea8d64 (patch)
treede3d52fcdf48a69806a41e408065b7f119206610 /src/client/react/actions/view.js
parent0c99c0b4d84f53675cc3d42fa518879789cc86b0 (diff)
Implement week selector in the view
Diffstat (limited to 'src/client/react/actions/view.js')
-rw-r--r--src/client/react/actions/view.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/react/actions/view.js b/src/client/react/actions/view.js
index f9f0be2..79ec143 100644
--- a/src/client/react/actions/view.js
+++ b/src/client/react/actions/view.js
@@ -1,17 +1,19 @@
// eslint-disable-next-line import/prefer-default-export
-export const fetchSchedule = user => (dispatch) => {
+export const fetchSchedule = (user, week) => (dispatch) => {
dispatch({
type: 'VIEW/FETCH_SCHEDULE_REQUEST',
user,
+ week,
});
- fetch(`/get/${user}`).then(
+ fetch(`/get/${user}?week=${week}`).then(
// success
(r) => {
r.text().then((htmlStr) => {
dispatch({
type: 'VIEW/FETCH_SCHEDULE_SUCCESS',
user,
+ week,
htmlStr,
});
});
@@ -21,6 +23,7 @@ export const fetchSchedule = user => (dispatch) => {
() => {
dispatch({
type: 'VIEW/FETCH_SCHEDULE_FAILURE',
+ week,
user,
});
},