Merge pull request #6328 from FreeCodeCamp/fix/job-board-bugs

Fix job submit infinite loop/promo ajax bugs
This commit is contained in:
Arsen Melikyan
2016-01-24 11:03:19 +04:00
4 changed files with 7 additions and 11 deletions

View File

@ -55,9 +55,14 @@ export default contain(
jobActions: PropTypes.object
},
componentDidMount() {
const { jobActions } = this.props;
jobActions.clearPromo();
},
goToJobBoard() {
const { appActions } = this.props;
appActions.goTo('/jobs');
setTimeout(() => appActions.goTo('/jobs'), 0);
},
renderDiscount(discountAmount) {

View File

@ -1,5 +1,4 @@
import React, { PropTypes } from 'react';
import { Lifecycle } from 'react-router';
import { Button, Row, Col } from 'react-bootstrap';
import { contain } from 'thundercats-react';
@ -26,8 +25,6 @@ export default contain(
jobActions: PropTypes.object
},
mixins: [Lifecycle],
componentDidMount() {
const { appActions, job } = this.props;
// redirect user in client
@ -36,11 +33,6 @@ export default contain(
}
},
routerWillLeave() {
const { jobActions } = this.props;
jobActions.clearPromo();
},
render() {
const { appActions, job, jobActions } = this.props;

View File

@ -138,7 +138,6 @@ export default Actions({
body.type = type;
}
return this.postJSON$('/api/promos/getButton', body)
.pluck('response')
.map(({ promo }) => {
if (!promo || !promo.buttonId) {
return noOper;

View File

@ -90,7 +90,7 @@
"loopback": "^2.22.0",
"loopback-boot": "^2.13.0",
"loopback-component-passport": "^1.6.0",
"loopback-connector-mongodb": "1.13.3",
"loopback-connector-mongodb": "1.13.0",
"merge-stream": "^1.0.0",
"method-override": "^2.3.0",
"moment": "^2.10.2",