import { DynamoDBClient , DeleteItemCommand } from "@aws-sdk/client-dynamodb" ; import { marshall } from "@aws-sdk/util-dynamodb" ; import { success , failure } from "./libs/response" ; import { APIGatewayEvent } from "aws-lambda" ; export const handler = async ( event ) => { const params = { TableName : process . env . NOTES_TABLE_NAME || "" , Key : marshall ( { noteId : event . pathParameters ?. id } ) , } ; try { const client = new DynamoDBClient ( { } ) ; await client . send ( new DeleteItemCommand ( params ) ) ; return success ( { status : true } ) ; } catch ( e ) { console . log ( e ) ; return failure ( { status : false } ) ; } } ;