aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/javascript/vehicle_journeys/reducers/modal.js9
-rw-r--r--app/views/vehicle_journeys/index.html.slim2
2 files changed, 2 insertions, 9 deletions
diff --git a/app/javascript/vehicle_journeys/reducers/modal.js b/app/javascript/vehicle_journeys/reducers/modal.js
index c2556303d..fb7e16547 100644
--- a/app/javascript/vehicle_journeys/reducers/modal.js
+++ b/app/javascript/vehicle_journeys/reducers/modal.js
@@ -147,14 +147,7 @@ export default function modal(state = {}, action) {
let stopAreas = _.map(window.jpOriginStopPoints, (sa, i) =>{
return _.assign({}, {stop_area_short_description : {id : sa.stop_area_id}})
})
- selectedJP = {
- id: window.jpOrigin.id,
- name: window.jpOrigin.name,
- published_name: window.jpOrigin.published_name,
- objectid: window.jpOrigin.objectid,
- stop_areas: stopAreas,
- missions: state.missions
- }
+ selectedJP = _.assign({}, window.jpOrigin, {stop_areas: stopAreas})
}
return {
type: 'create',
diff --git a/app/views/vehicle_journeys/index.html.slim b/app/views/vehicle_journeys/index.html.slim
index f7796b188..2c7a3b97d 100644
--- a/app/views/vehicle_journeys/index.html.slim
+++ b/app/views/vehicle_journeys/index.html.slim
@@ -17,7 +17,7 @@
= javascript_tag do
| window.route_id = #{params[:route_id]};
| window.stopPoints = #{(@stop_points_list.to_json).html_safe};
- | window.jpOrigin = #{(@jp_origin.to_json).html_safe};
+ | window.jpOrigin = #{(@jp_origin.attributes.update({full_schedule: @jp_origin.full_schedule?}).to_json).html_safe};
| window.jpOriginStopPoints = #{(@jp_origin_stop_points.to_json).html_safe};
| window.transportMode = #{(@transport_mode.to_json).html_safe};
| window.transportSubmode = #{(@transport_submode.to_json).html_safe};