@@ -82,10 +82,6 @@ type LinkryDeleteRequest = {
8282 Body : undefined ;
8383} ;
8484
85- const dynamoClient = new DynamoDBClient ( {
86- region : genericConfig . AwsRegion ,
87- } ) ;
88-
8985const linkryRoutes : FastifyPluginAsync = async ( fastify , _options ) => {
9086 const limitedRoutes : FastifyPluginAsync = async ( fastify ) => {
9187 fastify . register ( rateLimiter , {
@@ -269,7 +265,7 @@ const linkryRoutes: FastifyPluginAsync = async (fastify, _options) => {
269265 } ) ,
270266 } ) ;
271267
272- const existingGroups = await dynamoClient . send ( queryCommand ) ;
268+ const existingGroups = await fastify . dynamoClient . send ( queryCommand ) ;
273269 const existingGroupSet = new Set < string > ( ) ;
274270 let existingGroupTimestampMismatch = false ;
275271
@@ -407,7 +403,8 @@ const linkryRoutes: FastifyPluginAsync = async (fastify, _options) => {
407403
408404 TransactItems . push ( deleteItem ) ;
409405 }
410- await dynamoClient . send (
406+ console . log ( "TRANSACTION" , JSON . stringify ( TransactItems ) ) ;
407+ await fastify . dynamoClient . send (
411408 new TransactWriteItemsCommand ( { TransactItems } ) ,
412409 ) ;
413410 } catch ( e ) {
@@ -578,7 +575,7 @@ const linkryRoutes: FastifyPluginAsync = async (fastify, _options) => {
578575 } ,
579576 ] ;
580577 try {
581- await dynamoClient . send (
578+ await fastify . dynamoClient . send (
582579 new TransactWriteItemsCommand ( { TransactItems } ) ,
583580 ) ;
584581 } catch ( e ) {
0 commit comments