aboutsummaryrefslogtreecommitdiffstats
path: root/app/javascript/journey_patterns/actions
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/journey_patterns/actions')
-rw-r--r--app/javascript/journey_patterns/actions/index.js23
1 files changed, 13 insertions, 10 deletions
diff --git a/app/javascript/journey_patterns/actions/index.js b/app/javascript/journey_patterns/actions/index.js
index 4ff3f77ea..a70a2e6f2 100644
--- a/app/javascript/journey_patterns/actions/index.js
+++ b/app/javascript/journey_patterns/actions/index.js
@@ -64,6 +64,11 @@ const actions = {
type : 'DELETE_JOURNEYPATTERN',
index,
}),
+ updateJourneyPatternCosts : (index, costs) => ({
+ type : 'UPDATE_JOURNEYPATTERN_COSTS',
+ index,
+ costs
+ }),
closeModal : () => ({
type : 'CLOSE_MODAL'
}),
@@ -194,15 +199,13 @@ const actions = {
}
})
}
- journeyPatterns.push({
- name: val.name,
- object_id: val.object_id,
- short_id: val.short_id,
- published_name: val.published_name,
- registration_number: val.registration_number,
- stop_points: val.route_short_description.stop_points,
- deletable: false
- })
+ journeyPatterns.push(
+ _.assign({}, val, {
+ stop_points: val.route_short_description.stop_points,
+ costs: val.costs || {},
+ deletable: false
+ })
+ )
}
}
window.currentItemsLength = journeyPatterns.length
@@ -217,4 +220,4 @@ const actions = {
}
}
-export default actions \ No newline at end of file
+export default actions