diff --git a/app/lib/express.js b/app/lib/express.js index d77edc3..5a446eb 100644 --- a/app/lib/express.js +++ b/app/lib/express.js @@ -310,14 +310,27 @@ router.get( return res.redirect("/"); } - const [profile, posts, friends, friendshipStatus] = await Promise.all([ + const [ + profile, + posts, + friends, + friendshipStatus, + communities, + ] = await Promise.all([ queries.getProfile(id), queries.getPosts({ id }), queries.getFriends({ id }), queries.getFriendshipStatus(req.context.profile.id, id), + queries.getProfileCommunities(id), ]); - res.render("profile", { profile, posts, friends, friendshipStatus }); + res.render("profile", { + profile, + posts, + friends, + friendshipStatus, + communities, + }); } ); diff --git a/app/lib/mobile-routes.js b/app/lib/mobile-routes.js index 6732121..447d8a1 100644 --- a/app/lib/mobile-routes.js +++ b/app/lib/mobile-routes.js @@ -54,11 +54,18 @@ module.exports.setupRoutes = (router) => { return res.redirect("/mobile"); } - const [profile, posts, friends, friendshipStatus] = await Promise.all([ + const [ + profile, + posts, + friends, + friendshipStatus, + communities, + ] = await Promise.all([ queries.getProfile(id), queries.getPosts({ id }), queries.getFriends({ id }), queries.getFriendshipStatus(req.context.profile.id, id), + queries.getProfileCommunities(id), ]); res.render("mobile/profile", { @@ -66,6 +73,7 @@ module.exports.setupRoutes = (router) => { posts, friends, friendshipStatus, + communities, layout: "mobile/_layout", }); } diff --git a/app/views/mobile/profile.ejs b/app/views/mobile/profile.ejs index 7a4debc..7ef02e0 100644 --- a/app/views/mobile/profile.ejs +++ b/app/views/mobile/profile.ejs @@ -29,6 +29,9 @@ +
No friends
+ <% } %> + +No communities
+ <% } %>