feat: follow requests
This commit is contained in:
parent
563541d0e6
commit
e3586f4eec
4 changed files with 179 additions and 3 deletions
|
@ -202,6 +202,40 @@ export async function getFollowRequests(host, token, since_id, max_id, limit) {
|
|||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /api/v1/follow_requests/:account_id/authorize
|
||||
* @param {string} host - The domain of the target server.
|
||||
* @param {string} token - The application token.
|
||||
* @param {string} account_id - The account ID of the follow request to accept
|
||||
*/
|
||||
export async function acceptFollowRequest(host, token, account_id) {
|
||||
let url = `https://${host}/api/v1/follow_requests/${account_id}/authorize`;
|
||||
|
||||
const data = await fetch(url, {
|
||||
method: 'POST',
|
||||
headers: { "Authorization": "Bearer " + token }
|
||||
}).then(res => res.json());
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /api/v1/follow_requests/:account_id/reject
|
||||
* @param {string} host - The domain of the target server.
|
||||
* @param {string} token - The application token.
|
||||
* @param {string} account_id - The account ID of the follow request to reject
|
||||
*/
|
||||
export async function rejectFollowRequest(host, token, account_id) {
|
||||
let url = `https://${host}/api/v1/follow_requests/${account_id}/reject`;
|
||||
|
||||
const data = await fetch(url, {
|
||||
method: 'POST',
|
||||
headers: { "Authorization": "Bearer " + token }
|
||||
}).then(res => res.json());
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /api/v1/timelines/{timeline}
|
||||
* @param {string} host - The domain of the target server.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue