From f48e4487450821732acfc86ff872b20c3169e802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=20Lis=C3=A9?= Date: Tue, 28 May 2024 13:59:23 -0400 Subject: [PATCH] 335: Filter out hold passes. (#397) --- lambda/readPass/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lambda/readPass/index.js b/lambda/readPass/index.js index a1dd1cc5..105d4691 100644 --- a/lambda/readPass/index.js +++ b/lambda/readPass/index.js @@ -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) {