aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorXinhui2017-02-20 11:51:58 +0100
committerXinhui2017-02-20 11:52:06 +0100
commit893cc9d5683ae04e202cbe0560261b2a7c2f90fb (patch)
tree5c6007073bb31d3879131ffb8edf6f99f12d6208 /app/controllers
parent86cd6fb168b94debc3fc0eb99ac61f1a9b9b0049 (diff)
downloadchouette-core-893cc9d5683ae04e202cbe0560261b2a7c2f90fb.tar.bz2
Vehicle Journey update state for arrival & departure time
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/vehicle_journeys_collections_controller.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/controllers/vehicle_journeys_collections_controller.rb b/app/controllers/vehicle_journeys_collections_controller.rb
index c32ffbbdd..caaa2258e 100644
--- a/app/controllers/vehicle_journeys_collections_controller.rb
+++ b/app/controllers/vehicle_journeys_collections_controller.rb
@@ -9,10 +9,9 @@ class VehicleJourneysCollectionsController < ChouetteController
def update
state = JSON.parse request.raw_post
- ap '-----------------'
- ap state
- ap '-----------------'
- errors = false
+ Chouette::VehicleJourney.state_update route, state
+ errors = state.any? {|item| item['errors']}
+
respond_to do |format|
format.json { render json: state, status: errors ? :unprocessable_entity : :ok }
end