aboutsummaryrefslogtreecommitdiffstats
path: root/routes/funding.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-09-02 14:47:08 -0700
committerAdam Soltys <[email protected]>2022-09-02 14:47:14 -0700
commit3161dd7ee95b6c7d70f8341298dd4fab84cda8b0 (patch)
tree16cd6c55d5dc481331b1e8b640d179f193e7ea13 /routes/funding.js
parent7a8d64833de8873afb92982b3f5bfff59b30c542 (diff)
downloadcoinos-server-3161dd7ee95b6c7d70f8341298dd4fab84cda8b0.tar.gz
coinos-server-3161dd7ee95b6c7d70f8341298dd4fab84cda8b0.zip
es6 migration
Diffstat (limited to 'routes/funding.js')
-rw-r--r--routes/funding.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/routes/funding.js b/routes/funding.js
index 7edcd713..9d305010 100644
--- a/routes/funding.js
+++ b/routes/funding.js
@@ -1,3 +1,5 @@
+import app from "../app.js";
+import config from "../config/index.js";
import mailgunFactory from 'mailgun-js';
const mailgun = mailgunFactory(config.mailgun);
@@ -5,7 +7,7 @@ app.post(
"/id",
auth,
upload.single("id"),
- ah(async (req, res) => {
+ async (req, res) => {
const { user } = req;
if (user.verified === "proof") user.verified = "pending";
else user.verified = "id";
@@ -24,13 +26,12 @@ app.post(
res.end();
})
-);
app.post(
"/proof",
auth,
upload.single("proof"),
- ah(async (req, res) => {
+ async (req, res) => {
const { user } = req;
if (user.verified === "id") user.verified = "pending";
else user.verified = "proof";
@@ -40,12 +41,11 @@ app.post(
res.end();
})
-);
app.post(
"/funding",
auth,
- ah(async (req, res) => {
+ async (req, res) => {
try {
let { id, amount, code } = req.body;
@@ -81,12 +81,11 @@ app.post(
res.status(500).send("Funding request failed");
}
})
-);
app.post(
"/withdrawal",
auth,
- ah(async (req, res) => {
+ async (req, res) => {
try {
const { account, amount, email, institution, transit, notes } = req.body;
if (!parseFloat(amount) || parseFloat(amount) < 0)
@@ -108,4 +107,3 @@ app.post(
res.status(500).send("Withdrawal request failed");
}
})
-);