Skip to content

Commit 6366480

Browse files
author
David Emory
committed
fix(form): Update PlanTripButton to work with recent API refactor
1 parent 3d8e3e4 commit 6366480

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

lib/components/form/plan-trip-button.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { Component, PropTypes } from 'react'
22
import { Button } from 'react-bootstrap'
33
import { connect } from 'react-redux'
44

5-
import { planTrip, profileTrip } from '../../actions/api'
5+
import { routingQuery } from '../../actions/api'
66

77
class PlanTripButton extends Component {
88
static propTypes = {
@@ -14,14 +14,7 @@ class PlanTripButton extends Component {
1414
}
1515

1616
_onClick = () => {
17-
switch (this.props.routingType) {
18-
case 'ITINERARY':
19-
this.props.planTrip()
20-
break
21-
case 'PROFILE':
22-
this.props.profileTrip()
23-
break
24-
}
17+
this.props.routingQuery()
2518
}
2619

2720
render () {
@@ -35,15 +28,12 @@ class PlanTripButton extends Component {
3528
}
3629

3730
const mapStateToProps = (state, ownProps) => {
38-
return {
39-
routingType: state.otp.currentQuery.routingType
40-
}
31+
return {}
4132
}
4233

4334
const mapDispatchToProps = (dispatch, ownProps) => {
4435
return {
45-
planTrip: () => { dispatch(planTrip()) },
46-
profileTrip: () => { dispatch(profileTrip()) }
36+
routingQuery: () => { dispatch(routingQuery()) }
4737
}
4838
}
4939

0 commit comments

Comments
 (0)