Skip to content

Commit

Permalink
fix(complete_driver_trip): parse body as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
Franco Méndez committed Oct 26, 2019
1 parent 69cba8c commit 76a05f6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions complete_driver_trip.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,16 @@ exports.handler = async (event) => {
const userId = await bearerToUserId.bearerToUserId(event.headers.Authorization.substring(7));
const tripId = event.pathParameters.trip;

const result = await completeTrip(tripId, userId);
await completeTrip(tripId, userId);
const responseBody = {
action: 'complete',
success: true,
resource: 'trip',
resource_id: tripId
};
return {
statusCode: 200,
headers: { 'Access-Control-Allow-Origin': '*' },
body: JSON.stringify(result)
body: JSON.stringify(responseBody)
};
};

0 comments on commit 76a05f6

Please sign in to comment.