profiles: friend and block through profile page :))
This commit is contained in:
@ -54,40 +54,6 @@ class Profiles
|
||||
return null;
|
||||
return profile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Block a user
|
||||
* @param {Number} user_id
|
||||
* @returns {Promise<Object>}
|
||||
*/
|
||||
async block(user_id) {
|
||||
|
||||
// blocker & blocked
|
||||
let response = await this.client._post("/api/profiles/block", {
|
||||
users_id:[this.client.me.id, user_id],
|
||||
});
|
||||
|
||||
let data = await response.json();
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Unblock a user
|
||||
* @param {Number} user_id
|
||||
* @returns {Promise<Object>}
|
||||
*/
|
||||
async deblock(user_id) {
|
||||
|
||||
// blocker & blocked
|
||||
let response = await this.client._delete("/api/profiles/block", {
|
||||
users_id:[this.client.me.id, user_id],
|
||||
});
|
||||
|
||||
let data = await response.json();
|
||||
return data;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export {Profiles};
|
||||
|
Reference in New Issue
Block a user