From da66d29966405b4cddaeb931e6126ffc5596dbd6 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Thu, 6 Feb 2020 21:15:15 -0800 Subject: [PATCH] only set distance if available --- compass/app/Jobs/TripComplete.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compass/app/Jobs/TripComplete.php b/compass/app/Jobs/TripComplete.php index 88e8c84..1c23c0e 100644 --- a/compass/app/Jobs/TripComplete.php +++ b/compass/app/Jobs/TripComplete.php @@ -44,11 +44,14 @@ class TripComplete extends Job implements SelfHandling, ShouldQueue 'mode' => $this->_data['properties']['mode'], 'start_location' => $this->_data['properties']['start_location'], 'end_location' => $this->_data['properties']['end_location'], - 'distance' => $this->_data['properties']['distance'], 'start' => $this->_data['properties']['start'], 'end' => $this->_data['properties']['end'] ] ]; + + if(isset($this->_data['properties']['distance'])) + $trip['trip']['distance'] = $this->_data['properties']['distance']; + $trip = json_encode($trip, JSON_UNESCAPED_SLASHES); foreach($urls as $url) {