Skip to content

Commit

Permalink
Update requirements for put and query.
Browse files Browse the repository at this point in the history
  • Loading branch information
wparad committed Feb 15, 2024
1 parent 0942b6e commit 9261ef7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dynamoDbSafe.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class DynamoDB extends DynamoDbOriginal.DocumentClient {

query(originalParams) {
if (!originalParams || !originalParams.TableName) { throw new DynamoDbError({ error: 'TableName not specified', parameters: originalParams }, 'InvalidParameters'); }
if (!originalParams.Key) { throw new DynamoDbError({ error: 'Key not specified', parameters: originalParams }, 'InvalidParameters'); }
if (!originalParams.KeyConditionExpression) { throw new DynamoDbError({ error: 'KeyConditionExpression not specified', parameters: originalParams }, 'InvalidParameters'); }

const params = originalParams;
const capturedStack = { name: 'DynamoDB.update() Error:' };
Expand Down Expand Up @@ -122,7 +122,7 @@ class DynamoDB extends DynamoDbOriginal.DocumentClient {

put(originalParams) {
if (!originalParams || !originalParams.TableName) { throw new DynamoDbError({ error: 'TableName not specified', parameters: originalParams }, 'InvalidParameters'); }
if (!originalParams.Key) { throw new DynamoDbError({ error: 'Key not specified', parameters: originalParams }, 'InvalidParameters'); }
if (!originalParams.Item) { throw new DynamoDbError({ error: 'Item not specified', parameters: originalParams }, 'InvalidParameters'); }

const conditionExpressionTokens = parseExpression(originalParams.ConditionExpression);
if (conditionExpressionTokens) {
Expand Down

0 comments on commit 9261ef7

Please sign in to comment.