From 8670ada517bc8beb69d152c82f282322b9ea8d64 Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Sun, 28 Jan 2018 15:43:11 +0100 Subject: Implement week selector in the view --- src/client/react/actions/view.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/client/react/actions') 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, }); }, -- cgit v1.1