server/controllers/AccountController.js
Function getSingleAccount
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static async getSingleAccount(req, res) {
const { accountNumber } = req.params;
if (req.decoded.type === 'staff') {
const accountDetails = await accounts.select(
['*'],
Function editAccountStatus
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static async editAccountStatus(req, res) {
const { accountNumber } = req.params;
const { status } = req.body;
if (req.decoded.type !== 'staff') {
return res.status(401).json({
Function createAccount
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static async createAccount(req, res) {
const { type } = req.body;
const { id, firstName, lastName, email } = req.decoded;
if (req.decoded.type === 'client') {
const accountNumber = Math.floor(Math.random() * 10 ** 10);
Function getTransactionHistory
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static async getTransactionHistory(req, res) {
const { accountNumber } = req.params;
const { id, type } = req.decoded;
const selectedAccount = await accounts.select(
['*'],