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()