Skip to content
This repository was archived by the owner on Jun 26, 2024. It is now read-only.

Commit 2e79a38

Browse files
authored
Merge pull request #47 from harryxp/fix-delete-todo-item
Fix a bug when deleting a TODO item.
2 parents 683c44d + fa4953d commit 2e79a38

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Diff for: todo-src/deleteTodo/app.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,9 @@ function getCognitoUsername(event){
4545
function deleteRecordById(username, recordId) {
4646
let params = {
4747
TableName: TABLE_NAME,
48-
KeyConditionExpression: "#username = :username",
49-
ExpressionAttributeNames:{
50-
"#username": "cognito-username"
51-
},
52-
ExpressionAttributeValues: {
53-
":username": username
48+
Key: {
49+
"cognito-username": username,
50+
"id": recordId
5451
}
5552
}
5653

0 commit comments

Comments
 (0)