Skip to content

Commit

Permalink
Merge pull request #62 from KOSASIH/deepsource-transform-b6cf9047
Browse files Browse the repository at this point in the history
style: format code with Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf
  • Loading branch information
KOSASIH authored May 10, 2024
2 parents 6b9fa13 + 5573434 commit 32f4cb1
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/routes/transfers.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
const express = require("express");
const router = express.Router();
const express = require('express')
const router = express.Router()

const TransferController = require("../controllers/transfers");
const authenticate = require("../middleware/auth");
const createTransaction = require("../middleware/network");
const TransferController = require('../controllers/transfers')
const authenticate = require('../middleware/auth')
const createTransaction = require('../middleware/network')

router.post("/", authenticate, async (req, res) => {
router.post('/', authenticate, async (req, res) => {
try {
const transfer = await TransferController.create(req, res);
const transactionHash = await createTransaction(req.user.wallet_address, req.body.receiver_account_id, req.body.amount);
transfer.transaction_hash = transactionHash;
await transfer.save();
res.json({ message: "Transfer successful", transfer });
const transfer = await TransferController.create(req, res)
const transactionHash = await createTransaction(
req.user.wallet_address,
req.body.receiver_account_id,
req.body.amount
)
transfer.transaction_hash = transactionHash
await transfer.save()
res.json({ message: 'Transfer successful', transfer })
} catch (error) {
res.status(400).json({ message: error.message });
res.status(400).json({ message: error.message })
}
});
})

module.exports = router;
module.exports = router

0 comments on commit 32f4cb1

Please sign in to comment.