Skip to content

Commit

Permalink
Make account name a route param for update permissions admin endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaloult committed May 8, 2022
1 parent a7530b1 commit 06a209c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions backend/api/admin/adminController.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const keysend = async (req, res) => {
// Request body:
// ```
// {
// accountName: string,
// permissions: {
// isAdmin: boolean,
// hasAllowance: boolean,
Expand All @@ -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)}`);
Expand Down
2 changes: 1 addition & 1 deletion backend/api/admin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 06a209c

Please sign in to comment.