title: How to getById in redux
body: <p>I am newbie in react and redux, trying to fetch data using api, but trying to fetch by id, unfortunately, <code>id</code> is undefined in redux logger and no result back from server side, </p>
  
  <p>Here is my code</p>
  
  <p><strong>My route</strong> <code>&lt;Route path="/admin/:id" component={AdminPage} /&gt;</code></p>
  
  <p><strong>Action</strong> </p>
  
  <pre><code>function getAll(id){
      return dispatch =&gt;{
          dispatch(request(id));
  
          adminService.getAll(id)
          .then( admin =&gt; {
  
              dispatch(success(admin));
              dispatch(alertActions.success('Welcome Back !'));
  
          },error =&gt; {
  
              dispatch(failure(error.toString()));
              dispatch(alertActions.error(error.toString()));
  
          });
  
      };
  
      function request(id)    { return { type: adminConstants.GETALL_REQUEST, id } }
      function success(admin) { return { type: adminConstants.GETALL_SUCCESS, admin } }
      function failure(error) { return { type: adminConstants.GETALL_FAILURE, error } }
  </code></pre>
  
  <p><strong>Reducer</strong></p>
  
  <pre><code>export function admin( state={}, action){
      switch(action.type){
  
          case adminConstants.GETALL_REQUEST:
          return { loading: true, id : action.id };
  
          case adminConstants.GETALL_SUCCESS:
          return { items: action.admin };
  
          case adminConstants.GETALL_FAILURE:
          return { error: action.error };
  
          default:
          return state
      }
  }
  </code></pre>
  
  <p><strong>Service</strong></p>
  
  <pre><code>function getAll(id){
  
      const requestOptions = {
          method : 'GET',
          headers: authHeader()
      };
      return fetch(`${apiUrl}/admin/${id}`, requestOptions).then(handleResponse)
      .then( data =&gt; {  return data; });
  }
  </code></pre>
  
  <p><strong>AdminPage</strong></p>
  
  <pre><code>class AdminPage extends React.Component{
  
  
  
      componentDidMount(){
          this.props.dispatch(adminActions.getAll());
      }
  
      render(){
          const { admin } = this.props;
          return(
              &lt;div&gt;
  
                  &lt;h3&gt; Admin Panel&lt;/h3&gt;
  
                  {admin.items &amp;&amp;
                      &lt;ul&gt;
                          {admin.items.map((data, index) =&gt;
                              &lt;li key={data.id}&gt;
                               email id : {data.email},
                               end date : {data.dateEnd},
                               customerId : {data.customerId}
  
                              &lt;/li&gt;
                          )}
                      &lt;/ul&gt;
                  }
  
  
              &lt;/div&gt;
              );
      }
  }
  
  
  
  
  function mapStateToProps(state) {
  
      const { admin } = state;
  
      return { admin};
  }
  
  
  const connectedAdminPage = connect(mapStateToProps)(AdminPage);
  export { connectedAdminPage as AdminPage };
  </code></pre>
  
  <p><strong>Link on Home page</strong></p>
  
  <pre><code>&lt;Link to="/admin/5c4f69d5259f7d14434b4cb6"&gt;Admin&lt;/Link&gt;
  </code></pre>