Skip to content

Commit db644a8

Browse files
committed
Returning for async functions
1 parent b4df732 commit db644a8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

delete.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as dynamoDbLib from "./libs/dynamodb-lib";
22
import { success, failure } from "./libs/response-lib";
33

4-
export async function main(event, context, callback) {
4+
export async function main(event, context) {
55
const params = {
66
TableName: "notes",
77
// 'Key' defines the partition key and sort key of the item to be removed
@@ -15,8 +15,8 @@ export async function main(event, context, callback) {
1515

1616
try {
1717
const result = await dynamoDbLib.call("delete", params);
18-
callback(null, success({ status: true }));
18+
return success({ status: true });
1919
} catch (e) {
20-
callback(null, failure({ status: false }));
20+
return failure({ status: false });
2121
}
2222
}

0 commit comments

Comments
 (0)