@@ -247,11 +247,6 @@ export class DynamodbService {
247
247
checkIfExists = true ,
248
248
tableName = this . tableName ,
249
249
) : Promise < PartialEntity < M > | undefined > {
250
- this . logger . debug (
251
- `[DynamoDB] Update: ${ data . partitionId } :${
252
- data . entityId
253
- } (${ JSON . stringify ( data ) } )`,
254
- ) ;
255
250
// eslint-disable-next-line @typescript-eslint/no-unused-vars
256
251
const { partitionId, entityId, entityType, ...rest } = data ;
257
252
const dataToUpdate = {
@@ -293,10 +288,14 @@ export class DynamodbService {
293
288
ReturnValues : 'ALL_NEW' ,
294
289
} )
295
290
. promise ( )
296
- . then (
297
- ( { Attributes } ) =>
298
- this . denormalizeData ( Attributes ) as PartialEntity < M > ,
299
- ) ;
291
+ . then ( ( { Attributes } ) => {
292
+ this . logger . debug (
293
+ `[DynamoDB] Update: ${ data . partitionId } :${
294
+ data . entityId
295
+ } (${ JSON . stringify ( data ) } )`,
296
+ ) ;
297
+ return this . denormalizeData ( Attributes ) as PartialEntity < M > ;
298
+ } ) ;
300
299
}
301
300
302
301
async updateItemByType < M > (
@@ -553,7 +552,6 @@ export class DynamodbService {
553
552
checkIfExists = true ,
554
553
tableName = this . tableName ,
555
554
) : Promise < PartialEntity < M > > {
556
- this . logger . debug ( `[DynamoDB] Put: ${ data . partitionId } :${ data . entityId } ` ) ;
557
555
const timestamp = Date . now ( ) ;
558
556
const dataToPut = {
559
557
createdAt : timestamp ,
@@ -572,7 +570,14 @@ export class DynamodbService {
572
570
: { } ) ,
573
571
} )
574
572
. promise ( )
575
- . then ( ( ) => this . denormalizeData ( dataToPut ) ) ;
573
+ . then ( ( ) => {
574
+ this . logger . debug (
575
+ `[DynamoDB] Put: ${ data . partitionId } :${
576
+ data . entityId
577
+ } (${ JSON . stringify ( dataToPut ) } )`,
578
+ ) ;
579
+ return this . denormalizeData ( dataToPut ) as PartialEntity < M > ;
580
+ } ) ;
576
581
}
577
582
578
583
async putItemByType < M > (
0 commit comments