profiles(block): get profiles of blocked users
This commit is contained in:
@ -10,6 +10,22 @@ class MyProfile extends Profile
|
||||
constructor (client)
|
||||
{
|
||||
super(client, "../me");
|
||||
|
||||
/**
|
||||
* @type {[Profile]}
|
||||
*/
|
||||
this.blockedUsers = [];
|
||||
}
|
||||
|
||||
async init() {
|
||||
await super.init();
|
||||
await this.getBlockedUsers();
|
||||
}
|
||||
|
||||
async getBlockedUsers() {
|
||||
const response = await this.client._get('/api/profiles/block');
|
||||
const data = await response.json();
|
||||
data.forEach(profileData => this.blockedUsers.push(new Profile(this.client, profileData.username, profileData.user_id, profileData.avatar)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user