diff --git a/backend/api/admin/adminController.js b/backend/api/admin/adminController.js index d28b4b0..112ec1f 100644 --- a/backend/api/admin/adminController.js +++ b/backend/api/admin/adminController.js @@ -54,7 +54,6 @@ const keysend = async (req, res) => { // Request body: // ``` // { -// accountName: string, // permissions: { // isAdmin: boolean, // hasAllowance: boolean, @@ -65,7 +64,7 @@ const keysend = async (req, res) => { const updatePermissions = async (req, res) => { try { // TODO: Input verification logic? - const accountName = req.body.accountName; + const accountName = req.params.username; const newPermissions = req.body.permissions; const response = await adminService.updatePermissions(accountName, newPermissions); debug.info(`Response for updating a family member's permissions: ${JSON.stringify(response)}`); diff --git a/backend/api/admin/index.js b/backend/api/admin/index.js index 660491b..fd81543 100644 --- a/backend/api/admin/index.js +++ b/backend/api/admin/index.js @@ -6,7 +6,7 @@ const { getAllBalances, addNewAccount, keysend, updatePermissions, setAccountAll router.get('/balances', getAllBalances); router.post('/add', addNewAccount); router.post('/transfer', keysend); -router.post('/permissions', updatePermissions) +router.post('/account/:username/permissions', updatePermissions) router.post('/allowance', setAccountAllowance) module.exports = router;