Skip to content

Commit d69097c

Browse files
committed
fix dynamodb-toolbox#49 with await
1 parent a9e8766 commit d69097c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

classes/Table.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,8 @@ class Table {
782782
} : null, // end if Responses
783783
// If UnprocessedKeys, return a next function
784784
result.UnprocessedKeys && Object.keys(result.UnprocessedKeys).length > 0 ? {
785-
next: () => {
786-
const nextResult = this.DocumentClient.batchGet(Object.assign(
785+
next: async () => {
786+
const nextResult = await this.DocumentClient.batchGet(Object.assign(
787787
{ RequestItems: result.UnprocessedKeys },
788788
options.capacity ? { ReturnConsumedCapacity: options.capacity.toUpperCase() } : null
789789
)).promise()
@@ -957,8 +957,8 @@ class Table {
957957
result,
958958
// If UnprocessedItems, return a next function
959959
result.UnprocessedItems && Object.keys(result.UnprocessedItems).length > 0 ? {
960-
next: () => {
961-
const nextResult = this.DocumentClient.batchWrite(Object.assign(
960+
next: async () => {
961+
const nextResult = await this.DocumentClient.batchWrite(Object.assign(
962962
{ RequestItems: result.UnprocessedItems },
963963
options.capacity ? { ReturnConsumedCapacity: options.capacity.toUpperCase() } : null,
964964
options.metrics ? { ReturnItemCollectionMetrics: options.metrics.toUpperCase() } : null

0 commit comments

Comments
 (0)