From 6ebb626a4beb1d47750c944c771e4f5487fb9ce4 Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Tue, 20 Mar 2018 16:51:59 +0100 Subject: Use setUser and setWeek everywhere --- src/client/react/components/container/Results.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/client/react/components/container/Results.js') diff --git a/src/client/react/components/container/Results.js b/src/client/react/components/container/Results.js index 5434eb4..4fc9987 100644 --- a/src/client/react/components/container/Results.js +++ b/src/client/react/components/container/Results.js @@ -25,7 +25,7 @@ import { connect } from 'react-redux'; import { withRouter } from 'react-router-dom'; import users from '../../users'; -import { userFromMatch } from '../../lib/url'; +import { setUser, userFromMatch } from '../../lib/url'; import Result from '../presentational/Result'; class Results extends React.Component { @@ -36,6 +36,7 @@ class Results extends React.Component { // react-router match: PropTypes.object.isRequired, + location: PropTypes.object.isRequired, history: PropTypes.object.isRequired, // redux @@ -74,7 +75,7 @@ class Results extends React.Component { // Therefor, we need to dispatch the SET_USER command manually. this.props.dispatch({ type: 'SEARCH/SET_USER', user }); } else { - this.props.history.push(`/${userId}`); + setUser(userId, this.props.location, this.props.history); } }} /> -- cgit v1.1