mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
[#1465] add member modals back in. Not all info is present, just a bit more
work. Can now click guild & tavern members! does lazy-loading of members so we don't have to load all their information at once
This commit is contained in:
@@ -19,6 +19,14 @@ var api = module.exports;
|
||||
var usernameFields = 'auth.local.username auth.facebook.displayName auth.facebook.givenName auth.facebook.familyName auth.facebook.name';
|
||||
var partyFields = 'profile preferences items stats achievements party backer flags.rest ' + usernameFields;
|
||||
|
||||
api.getMember = function(req, res) {
|
||||
User.findById(req.params.uid).select(partyFields).exec(function(err, user){
|
||||
if (err) return res.json(500,{err:err});
|
||||
if (!user) return res.json(400,{err:'User not found'});
|
||||
res.json(user);
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get groups. If req.query.type privided, returned as an array (so ngResource can use). If not, returned as
|
||||
* object {guilds, public, party, tavern}. req.query.type can be comma-separated `type=guilds,party`
|
||||
|
||||
Reference in New Issue
Block a user