Skip to content

Commit

Permalink
335: Filter out hold passes. (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
marklise authored May 28, 2024
1 parent b96e049 commit f48e448
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lambda/readPass/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,16 @@ exports.handler = async (event, context) => {
queryObj.IndexName = 'manualLookup-index';
queryObj.ExpressionAttributeValues[':shortPassDate'] = { S: shortDate };
queryObj.ExpressionAttributeValues[':facilityName'] = { S: event.queryStringParameters.facilityName };
queryObj.ExpressionAttributeValues[':passStatus'] = AWS.DynamoDB.Converter.input('hold');
queryObj.KeyConditionExpression = 'shortPassDate =:shortPassDate AND facilityName =:facilityName';
queryObj.FilterExpression = '';
queryObj.FilterExpression = 'passStatus <> :passStatus';
} else {
queryObj.ExpressionAttributeValues = {};
queryObj.ExpressionAttributeValues[':pk'] = { S: 'pass::' + event.queryStringParameters.park };
queryObj.ExpressionAttributeValues[':facilityName'] = { S: event.queryStringParameters.facilityName };
queryObj.ExpressionAttributeValues[':passStatus'] = AWS.DynamoDB.Converter.input('hold');
queryObj.KeyConditionExpression = 'pk =:pk';
queryObj.FilterExpression = 'facilityName =:facilityName';
queryObj.FilterExpression = 'facilityName =:facilityName and passStatus <> :passStatus';
}

if (event.queryStringParameters.passType) {
Expand Down

0 comments on commit f48e448

Please sign in to comment.