Finished up with channel rank/perms frontend.
This commit is contained in:
parent
edb4215929
commit
796bb033a7
22 changed files with 472 additions and 57 deletions
|
|
@ -241,7 +241,7 @@ channelSchema.methods.setRank = async function(userDB,rank){
|
|||
|
||||
channelSchema.methods.getRankList = async function(){
|
||||
//Create an empty array to hold the user list
|
||||
const rankList = [];
|
||||
const rankList = new Map()
|
||||
|
||||
//Populate the user objects in our ranklist based off of their DB ID's
|
||||
await this.populate('rankList.user');
|
||||
|
|
@ -252,11 +252,12 @@ channelSchema.methods.getRankList = async function(){
|
|||
const userObj = {
|
||||
id: rankObj.user.id,
|
||||
user: rankObj.user.user,
|
||||
img: rankObj.user.img,
|
||||
rank: rankObj.rank
|
||||
}
|
||||
|
||||
//Add our user object to the list
|
||||
rankList.push(userObj);
|
||||
rankList.set(rankObj.user.user, userObj);
|
||||
});
|
||||
|
||||
//return userList
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue