diff options
author | Noah Loomans <noahloomans@gmail.com> | 2018-06-27 16:45:50 +0200 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2018-06-27 16:45:50 +0200 |
commit | 9e55c4b1a151b434cba4b4425514c3aeac6f22d8 (patch) | |
tree | fc77255f2b6e696eec435e3319df1546da8e5d0d /src/client/react/lib | |
parent | 3bfff2ec9bec03030d2cecd9d57880bcfde740f7 (diff) |
Only use history in makeSetUser and makeSetWeek
Diffstat (limited to 'src/client/react/lib')
-rw-r--r-- | src/client/react/lib/url.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/react/lib/url.js b/src/client/react/lib/url.js index c94383c..644fd74 100644 --- a/src/client/react/lib/url.js +++ b/src/client/react/lib/url.js @@ -43,20 +43,20 @@ export function weekFromLocation(location) { return purifyWeek(parseInt(weekStr, 10)); } -export function makeSetUser(location, history) { +export function makeSetUser(history) { return (userId) => { - const query = location.search; + const query = history.location.search; history.push(`/${userId}${query}`); }; } -export function makeSetWeek(location, history) { +export function makeSetWeek(history) { return (week) => { const query = queryString.stringify({ - ...queryString.parse(location.search), + ...queryString.parse(history.location.search), week, }); - history.push(`${location.pathname}?${query}`); + history.push(`${history.location.pathname}?${query}`); }; } |