Skip to content

Commit

Permalink
fix(model): fixing update and condition check syntax bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fishcharlie committed Feb 17, 2019
1 parent 77fbdad commit 74623bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Model.js
Expand Up @@ -420,7 +420,7 @@ Model.conditionCheck = async function (NewModel, key, options, next) {
const rangeKeyName = schema.rangeKey.name;
conditionReq.Key[rangeKeyName] = schema.rangeKey.toDynamo(key[rangeKeyName], undefined, key);
}
processCondition(conditionReq, options, schema);
await processCondition(conditionReq, options, schema);

debug('Condition Check', conditionReq);
deferred.resolve(conditionReq);
Expand Down Expand Up @@ -782,7 +782,7 @@ Model.update = async function (NewModel, key, update, options, next) {

if (schema.rangeKey) {
const rangeKeyName = schema.rangeKey.name;
updateReq.Key[rangeKeyName] = await schema.rangeKey.toDynamo(key[rangeKeyName]), undefined, key;
updateReq.Key[rangeKeyName] = await schema.rangeKey.toDynamo(key[rangeKeyName], undefined, key);
}

// determine the set of operations to be executed
Expand Down

0 comments on commit 74623bf

Please sign in to comment.