T-954157790456099: add isProfileNumberValidation check to getUserProfile endpoint

This commit is contained in:
Okechi Onyeje 2019-01-01 16:58:08 -05:00
parent 2449b207da
commit b49d62c151

View File

@ -35,8 +35,8 @@ async function updateUserProfile(req, res) {
async function getUserProfile(req, res) {
const profileNumber = req.params.profileNumber;
if (profileNumber > 4 || profileNumber < 1) {
res.status(http.BAD_REQUEST).json({error: errors.NO_PROFILE_FOUND_FOR_NUMBER});
if (!utils.isProfileNumberValid(profileNumber)) {
return;
} else {
const sessionId = utils.getSessionIdFromAuthHeader(req, res);
try {