From 0366dceea630b79d087ab608209cb44b562ade9d Mon Sep 17 00:00:00 2001 From: sterlingrules Date: Wed, 11 Mar 2020 14:27:43 -0400 Subject: [PATCH] fix(): profile path --- server/controllers/profile.controller.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/server/controllers/profile.controller.js b/server/controllers/profile.controller.js index 24c603e0..0b55f172 100644 --- a/server/controllers/profile.controller.js +++ b/server/controllers/profile.controller.js @@ -4,12 +4,7 @@ import { getActivityTree } from '../helpers/activity.helper'; const activityDays = 10; async function getPublic(req, res) { - const div = req.params.profileId.split('-'); - - if (!div.length || div.length === 1) return res.status(404).send(); - - const userId = div[div.length - 1]; - + const userId = req.params.profileId; const user = await User.findById(userId) .select('name bio avatarUrl') .lean()