Fix jobs fetch

pull/7214/head
Berkeley Martinez 2016-02-28 17:00:31 -08:00
parent 6bff10ea9c
commit 5c76978377
3 changed files with 9 additions and 12 deletions

View File

@ -2,7 +2,7 @@ import React, { cloneElement, PropTypes } from 'react';
import { compose } from 'redux';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { push } from 'react-router-redux';
import { LinkContainer } from 'react-router-bootstrap';
import PureComponent from 'react-pure-render/component';
import { Button, Row, Col } from 'react-bootstrap';
@ -26,8 +26,7 @@ const mapStateToProps = createSelector(
const bindableActions = {
findJob,
fetchJobs,
push
fetchJobs
};
const fetchOptions = {
@ -101,13 +100,11 @@ export class Jobs extends PureComponent {
sm={ 8 }
smOffset={ 2 }
xs={ 12 }>
<Button
className='signup-btn btn-block btn-cta'
onClick={ ()=> {
push('/jobs/new');
}}>
Post a job: $1,000
</Button>
<LinkContainer to='/jobs/new' >
<Button className='signup-btn btn-block btn-cta'>
Post a job: $1,000
</Button>
</LinkContainer>
<div className='spacer' />
</Col>
</Row>

View File

@ -34,7 +34,7 @@ export default ({ services }) => ({ dispatch }) => next => {
return fetchJobsCompleted(
result.jobs[0],
{
entities: entities.jobs,
entities: entities.job,
results: result.jobs
}
);

View File

@ -34,7 +34,7 @@ export default handleActions(
newJob
};
},
[types.fetchJobCompleted]: (state, { payload: { jobs, currentJob } }) => ({
[types.fetchJobsCompleted]: (state, { payload: { jobs, currentJob } }) => ({
...state,
currentJob,
jobs