Skip to content

Commit

Permalink
feat(request_reservation): allow duplicated request if other was canc…
Browse files Browse the repository at this point in the history
…eled
  • Loading branch information
Franco Méndez committed Nov 3, 2019
1 parent 99346b2 commit b57cd4f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions request_reservation.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ async function checkDuplicated(tripId, userId) {
IndexName: ReservationsIndexName,
ProjectionExpression: 'trip_id, passenger_id',
KeyConditionExpression: 'passenger_id = :passengerId',
FilterExpression: 'trip_id = :tripId',
FilterExpression: 'trip_id = :tripId and reservation_status <> :reservationStatus',
ExpressionAttributeValues: {
':passengerId': userId,
':tripId': tripId
':tripId': tripId,
':reservationStatus': 'canceled'
}
};
const data = await dynamoDB.query(params).promise();
Expand Down

0 comments on commit b57cd4f

Please sign in to comment.