fix: improper params sent to get and getActor

This commit is contained in:
Julian Lam
2024-01-08 14:46:33 -05:00
parent ec3c6b67cd
commit 9221506b0f

View File

@@ -8,7 +8,7 @@ const controller = module.exports;
controller.get = async function (req, res, next) { controller.get = async function (req, res, next) {
const { userslug: uid } = req.params; const { userslug: uid } = req.params;
const actor = await getActor(uid); const actor = await getActor(req.uid, uid);
if (!actor) { if (!actor) {
return next(); return next();
} }
@@ -18,7 +18,7 @@ controller.get = async function (req, res, next) {
}; };
controller.getFollow = async function (tpl, name, req, res) { controller.getFollow = async function (tpl, name, req, res) {
const actor = await getActor(req.params.userslug); const actor = await getActor(req.uid, req.params.userslug);
const { userslug } = req.params; const { userslug } = req.params;
const { preferredUsername: username, followerCount, followingCount } = actor; const { preferredUsername: username, followerCount, followingCount } = actor;
@@ -30,7 +30,7 @@ controller.getFollow = async function (tpl, name, req, res) {
}; };
payload.title = `[[pages:${tpl}, ${username}]]`; payload.title = `[[pages:${tpl}, ${username}]]`;
const collection = await get(`${actor[name]}?page=${page}`); const collection = await get(req.uid, `${actor[name]}?page=${page}`);
const resultsPerPage = collection.orderedItems.length; const resultsPerPage = collection.orderedItems.length;
payload.users = await mockProfile(collection.orderedItems, req.uid); payload.users = await mockProfile(collection.orderedItems, req.uid);