Finished up with channel rank/perms frontend.

This commit is contained in:
rainbow napkin 2024-11-27 02:16:54 -05:00
parent edb4215929
commit 796bb033a7
22 changed files with 472 additions and 57 deletions

View file

@ -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