1

I using a serverless-offline to run AWS-lambda locally on my Mac book. Then I fetch the endpoint to remove 1 user's data. Here is the code:

export const deleteItem = async <T extends BasePersistent>(item: T) => {
  const params: AWS.DynamoDB.DocumentClient.DeleteItemInput = {
    TableName: process.env.AWS_DYNAMODB_TABLE_NAME!,
    Key: {
      PK: item.PK,
      SK: item.SK,
    },
  };
  const rst = await docClient.delete(params).promise();
  return rst;
};

The "rst" is (I don't know why when I copy the "rst", will copy an empty object like {} ):

enter image description here

The rst.$response:

enter image description here

The rst.$response.data:

enter image description here

The rst.$response.request:

enter image description here

After I delete the item, I check the result on the AWS console, and I found the items still there.

Kody Liou
  • 113
  • 2
  • 12

0 Answers0