Fix jobs fetch
parent
6bff10ea9c
commit
5c76978377
|
@ -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>
|
||||
|
|
|
@ -34,7 +34,7 @@ export default ({ services }) => ({ dispatch }) => next => {
|
|||
return fetchJobsCompleted(
|
||||
result.jobs[0],
|
||||
{
|
||||
entities: entities.jobs,
|
||||
entities: entities.job,
|
||||
results: result.jobs
|
||||
}
|
||||
);
|
||||
|
|
|
@ -34,7 +34,7 @@ export default handleActions(
|
|||
newJob
|
||||
};
|
||||
},
|
||||
[types.fetchJobCompleted]: (state, { payload: { jobs, currentJob } }) => ({
|
||||
[types.fetchJobsCompleted]: (state, { payload: { jobs, currentJob } }) => ({
|
||||
...state,
|
||||
currentJob,
|
||||
jobs
|
||||
|
|
Loading…
Reference in New Issue