Skip to content

Commit 4b44407

Browse files
committed
Returning for async functions
1 parent 97cf5cb commit 4b44407

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

billing.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import stripePackage from "stripe";
22
import { calculateCost } from "./libs/billing-lib";
33
import { success, failure } from "./libs/response-lib";
44

5-
export async function main(event, context, callback) {
5+
export async function main(event, context) {
66
const { storage, source } = JSON.parse(event.body);
77
const amount = calculateCost(storage);
88
const description = "Scratch charge";
@@ -17,8 +17,8 @@ export async function main(event, context, callback) {
1717
description,
1818
currency: "usd"
1919
});
20-
callback(null, success({ status: true }));
20+
return success({ status: true });
2121
} catch (e) {
22-
callback(null, failure({ message: e.message }));
22+
return failure({ message: e.message });
2323
}
2424
}

0 commit comments

Comments
 (0)