Skip to content

Commit 1ce6bc4

Browse files
committed
log
1 parent 621e34b commit 1ce6bc4

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/api/routes/linkry.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ type LinkryDeleteRequest = {
8282
Body: undefined;
8383
};
8484

85-
const dynamoClient = new DynamoDBClient({
86-
region: genericConfig.AwsRegion,
87-
});
88-
8985
const 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

Comments
 (0)