diff --git a/src/controllers/accounts.js b/src/controllers/accounts.js index 7a59dbdaf..8b93c643f 100644 --- a/src/controllers/accounts.js +++ b/src/controllers/accounts.js @@ -1,16 +1,16 @@ -const Account = require("../models/account"); +const Account = require('../models/account') exports.list = async (req, res) => { - const accounts = await Account.find({ owner: req.user._id }); - res.json(accounts); -}; + const accounts = await Account.find({ owner: req.user._id }) + res.json(accounts) +} exports.create = async (req, res) => { const account = new Account({ account_name: req.body.account_name, initial_balance: req.body.initial_balance, - owner: req.user._id, - }); - await account.save(); - res.json({ message: "Account created!", account }); -}; + owner: req.user._id + }) + await account.save() + res.json({ message: 'Account created!', account }) +}