File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 33import { CognitoJwtVerifier } from "aws-jwt-verify" ;
44import { APIGatewayProxyEventV2 } from "aws-lambda" ;
55import { DynamoDBClient } from '@aws-sdk/client-dynamodb' ;
6- import { DynamoDBDocumentClient , PutCommand } from '@aws-sdk/lib-dynamodb' ;
6+ import { DynamoDBDocumentClient , GetCommand , PutCommand } from '@aws-sdk/lib-dynamodb' ;
77import { ApiGatewayManagementApiClient , PostToConnectionCommand } from "@aws-sdk/client-apigatewaymanagementapi" ;
88
99type WebSocketRequestContext = APIGatewayProxyEventV2 [ "requestContext" ] & {
@@ -76,7 +76,19 @@ export const handler = async (event: WebSocketEvent) => {
7676 } )
7777 ) ;
7878 console . log ( `Result: ${ JSON . stringify ( result ) } ` ) ;
79- console . log ( "Record written" ) ;
79+
80+ // get the record to make sure
81+ const getRec = await ddbDocClient . send (
82+ new GetCommand ( {
83+ TableName : process . env . ABSTRACT_PLAY_TABLE ,
84+ Key : {
85+ "pk" : "wsConnections" ,
86+ "sk" : connectionId
87+ } ,
88+ } )
89+ ) ;
90+ console . log ( `Found record: ${ JSON . stringify ( getRec ) } ` ) ;
91+
8092 // Now send a message back to the client
8193 const apiGwClient = new ApiGatewayManagementApiClient ( {
8294 region : REGION ,
You can’t perform that action at this time.
0 commit comments