Skip to content

Commit

Permalink
NOBUG: Update conditions (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
marklise authored Jun 11, 2024
1 parent c499a63 commit fc18501
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lambda/dynamoUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,8 @@ async function restoreAvailablePass(pk, sk, orcNumber, shortPassDate, facilityNa
Key: {
pk: { S: pk },
sk: { S: sk }
}
},
ConditionExpression: 'attribute_exists (pk) AND attribute_exists (sk)'
}
},
{
Expand All @@ -529,7 +530,8 @@ async function restoreAvailablePass(pk, sk, orcNumber, shortPassDate, facilityNa
Key: {
pk: { S: passPk },
sk: { S: passSk }
}
},
ConditionExpression: 'attribute_exists (pk) AND attribute_exists (sk)'
}
}]
};
Expand Down
2 changes: 1 addition & 1 deletion lambda/writePass/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ async function transactWriteWithRetries(transactionObj, maxRetries = 3) {
cancellationReasons = cancellationReasons.slice(0, -1);
cancellationReasons = cancellationReasons.split(', ');
let message = error.message;
let reasonIndex = this.cancellationReasons.findIndex((i) => i !== 'None');
let reasonIndex = cancellationReasons.findIndex((i) => i !== 'None');
if (reasonIndex > -1) {
switch (reasonIndex) {
case 0:
Expand Down

0 comments on commit fc18501

Please sign in to comment.