added new endpoint
This commit is contained in:
parent
3858a3c06e
commit
0b32306f84
|
@ -65,6 +65,14 @@ class GroupController {
|
||||||
|
|
||||||
return res.status(200).send(result);
|
return res.status(200).send(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getAdminId(req, res) {
|
||||||
|
const groupId = req.params.groupId;
|
||||||
|
|
||||||
|
let result = await GroupService.getAdminId(groupId);
|
||||||
|
|
||||||
|
return res.status(200).send(result.toString())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new GroupController();
|
export default new GroupController();
|
||||||
|
|
|
@ -12,4 +12,6 @@ GroupRouter.post('/password/:groupId', tryHandler(auth.authenticate), tryHandler
|
||||||
GroupRouter.get('/byName/:groupName', tryHandler(auth.authenticate), tryHandler(existance.groupNameExists), tryHandler(GroupController.getByName))
|
GroupRouter.get('/byName/:groupName', tryHandler(auth.authenticate), tryHandler(existance.groupNameExists), tryHandler(GroupController.getByName))
|
||||||
GroupRouter.get('/byId/:groupId', tryHandler(auth.authenticate), tryHandler(existance.groupExists), tryHandler(auth.userIsInGroup), tryHandler(GroupController.getById))
|
GroupRouter.get('/byId/:groupId', tryHandler(auth.authenticate), tryHandler(existance.groupExists), tryHandler(auth.userIsInGroup), tryHandler(GroupController.getById))
|
||||||
GroupRouter.get('/getUsers/:groupId', tryHandler(auth.authenticate), tryHandler(existance.groupExists), tryHandler(auth.userIsInGroup), tryHandler(GroupController.getUsersInGroup))
|
GroupRouter.get('/getUsers/:groupId', tryHandler(auth.authenticate), tryHandler(existance.groupExists), tryHandler(auth.userIsInGroup), tryHandler(GroupController.getUsersInGroup))
|
||||||
|
GroupRouter.get('/adminId/:groupId', tryHandler(auth.authenticate), tryHandler(existance.groupExists), tryHandler(auth.userIsInGroup), tryHandler(GroupController.getAdminId))
|
||||||
|
|
||||||
export default GroupRouter;
|
export default GroupRouter;
|
Loading…
Reference in New Issue