get public user working
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user