@squiz/db-lib 1.70.0 → 1.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/lib/index.js +4 -0
- package/lib/index.js.map +2 -2
- package/package.json +1 -1
- package/src/dynamodb/AbstractDynamoDbRepository.spec.ts +0 -1
- package/src/dynamodb/AbstractDynamoDbRepository.ts +2 -0
- package/src/dynamodb/DynamoDbManager.ts +3 -0
- package/tsconfig.tsbuildinfo +1 -1
package/package.json
CHANGED
@@ -307,6 +307,8 @@ export abstract class AbstractDynamoDbRepository<SHAPE extends object, DATA_CLAS
|
|
307
307
|
};
|
308
308
|
|
309
309
|
if (transaction.id?.length) {
|
310
|
+
// For transaction block, don't worry if the item being deleted does not exist
|
311
|
+
delete deleteCommandInput.ConditionExpression;
|
310
312
|
// this command will be executed together with
|
311
313
|
// other db write commands in the "transaction block"
|
312
314
|
this.dbManager.addWriteTransactionItem(transaction.id, {
|
@@ -49,6 +49,9 @@ export class DynamoDbManager<TRepositories> {
|
|
49
49
|
if (this.transactionItems[transactionId] === undefined) {
|
50
50
|
throw new TransactionError(`No items in transaction '${transactionId}' to execute`);
|
51
51
|
}
|
52
|
+
if (!this.transactionItems[transactionId].length) {
|
53
|
+
return;
|
54
|
+
}
|
52
55
|
|
53
56
|
return tracer.startActiveSpan(
|
54
57
|
'executeTransaction',
|