Skip to content

Commit

Permalink
refactor: replace use of Status with new Status#CreatedAt attribute w…
Browse files Browse the repository at this point in the history
…hen requesting Vault items
  • Loading branch information
craigzour committed Nov 26, 2024
1 parent 55bab72 commit fd9f9e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lambda-code/nagware/lib/dynamodbDataLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export async function retrieveNewOrDownloadedFormResponsesOver28DaysOld() {
TableName: DYNAMODB_VAULT_TABLE_NAME,
ExclusiveStartKey: lastEvaluatedKey ?? undefined,
FilterExpression:
"(#status = :statusNew OR #status = :statusDownloaded) AND CreatedAt <= :createdAt",
"(begins_with(#statusCreatedAt, :statusNew) OR begins_with(#statusCreatedAt, :statusDownloaded)) AND CreatedAt <= :createdAt",
ProjectionExpression: "FormID,CreatedAt",
ExpressionAttributeNames: {
"#status": "Status",
"#statusCreatedAt": "Status#CreatedAt",
},
ExpressionAttributeValues: {
":statusNew": "New",
Expand Down
1 change: 0 additions & 1 deletion lambda-code/reliability/lib/dataLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ export async function saveToVault(
FormSubmissionLanguage: language,
CreatedAt: Number(createdAt),
SecurityAttribute: securityAttribute,
Status: "New",
"Status#CreatedAt": `New#${Number(createdAt)}`,
ConfirmationCode: confirmationCode,
Name: name,
Expand Down

0 comments on commit fd9f9e1

Please sign in to comment.