Skip to content

Commit

Permalink
fix(batch-write-single-table.request): typings
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmumenthaler committed Feb 6, 2019
1 parent 966f4fb commit 4cbba5c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class BatchWriteSingleTableRequest<T> extends BaseRequest<T,
this.params.ReturnItemCollectionMetrics = value
}

delete(items: T[]): BatchWriteSingleTableRequest<T> {
delete(items: Array<Partial<T>>): BatchWriteSingleTableRequest<T> {
if (this.params.RequestItems[this.tableName].length + items.length > BATCH_WRITE_MAX_REQUEST_ITEM_COUNT) {
throw new Error(`batch write takes at max ${BATCH_WRITE_MAX_REQUEST_ITEM_COUNT} items`)
}
Expand Down Expand Up @@ -66,6 +66,6 @@ export class BatchWriteSingleTableRequest<T> extends BaseRequest<T,
return batchWriteItemsWriteAll(this.dynamoDBWrapper, { ...this.params }, backoffTimer(), throttleTimeSlot)
}

private createDeleteRequest = (item: T): DynamoDB.WriteRequest => ({ DeleteRequest: { Key: this.toKey(item) } })
private createDeleteRequest = (item: Partial<T>): DynamoDB.WriteRequest => ({ DeleteRequest: { Key: this.toKey(item) } })
private createPutRequest = (item: T): DynamoDB.WriteRequest => ({ PutRequest: { Item: toDb(item, this.modelClazz) } })
}

0 comments on commit 4cbba5c

Please sign in to comment.