diff --git a/backend/api/admin/adminController.js b/backend/api/admin/adminController.js index 112ec1f..d9e9da5 100644 --- a/backend/api/admin/adminController.js +++ b/backend/api/admin/adminController.js @@ -80,17 +80,16 @@ const updatePermissions = async (req, res) => { // Request body: // ``` // { -// accountName: string, // allowance: number, // } // ``` const setAccountAllowance = async (req, res) => { try { // TODO: Input verification logic? - const accountName = req.body.accountName; + const accountName = req.params.username; const newAllowance = req.body.allowance; const response = await adminService.setAccountAllowance(accountName, newAllowance); - debug.info(`Response for updating a family member's permissions: ${JSON.stringify(response)}`); + debug.info(`Response for setting a family member's allowance: ${JSON.stringify(response)}`); if (!response.success) res.status(500).json(response); else res.status(200).json(response); diff --git a/backend/api/admin/index.js b/backend/api/admin/index.js index fd81543..a73d5ed 100644 --- a/backend/api/admin/index.js +++ b/backend/api/admin/index.js @@ -7,6 +7,6 @@ router.get('/balances', getAllBalances); router.post('/add', addNewAccount); router.post('/transfer', keysend); router.post('/account/:username/permissions', updatePermissions) -router.post('/allowance', setAccountAllowance) +router.post('/account/:username/allowance', setAccountAllowance) module.exports = router;