Skip to content

Commit

Permalink
fix(batchWrite): await tableName
Browse files Browse the repository at this point in the history
  • Loading branch information
SajidHamza9 committed Jan 30, 2024
1 parent dc03695 commit 639d2e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/base-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -704,10 +704,10 @@ export default abstract class Model<T> {
//Make one BatchWrite request for every batch of 25 operations
let params: BatchWriteCommandInput;
const output: BatchWriteCommandOutput[] = await Promise.all(
batches.map(batch => {
batches.map(async (batch) => {
params = {
RequestItems: {
[this.tableName as string]: batch
[await this.tableName as string]: batch
}
}
if (options) {
Expand Down

0 comments on commit 639d2e2

Please sign in to comment.