get public user working

This commit is contained in:
talksik
2022-06-11 10:24:54 -05:00
parent 3855690181
commit acc80ad151
2 changed files with 20 additions and 17 deletions
-16
View File
@@ -23,9 +23,6 @@ export default function getUserRoutes() {
router.get('/login', login);
// get user public information by id
router.get('/:userId', authCheck, getPublicUser);
router.get('/authcheck', authCheck, handleAuthCheck);
return router;
@@ -48,19 +45,6 @@ async function getUserDetails(req: Request, res: Response, next: NextFunction) {
next(Error('No user found'));
}
async function getPublicUser(req: Request, res: Response, next: NextFunction) {
const { userId } = req.params;
const user = await UserService.getUserById(userId as string);
if (user) {
return res.status(200).json(new UserDetailsResponse(user));
}
res.status(404);
next(Error('No user found'));
}
/** Create user if doesn't exist
* Returns jwt token for client and user details
*/