From 55734341a1313c63084a5eadf1b78eff52c6ccfc Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Fri, 10 May 2024 07:42:03 +0000 Subject: [PATCH] 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 This commit fixes the style issues introduced in 564f06c according to the output from 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. Details: None --- src/routes/transfers.js | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/routes/transfers.js b/src/routes/transfers.js index 01b221fe7..a61bd45bc 100644 --- a/src/routes/transfers.js +++ b/src/routes/transfers.js @@ -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