add delete post api handler (#7)

This commit is contained in:
ari melody 2024-07-05 15:34:16 +01:00
parent 5ea28dc078
commit 0659772ab0
Signed by: ari
GPG key ID: CF99829C92678188

View file

@ -244,6 +244,22 @@ export async function editPost(host, token, post_id, post_data) {
return await data.json()
}
/**
* DELETE /api/v1/statuses/{post_id}
* @param {string} host - The domain of the target server.
* @param {string} token - The application token
* @param {any} post_id - The ID of the post to delete.
*/
export async function editPost(host, token, post_id) {
let url = `https://${host}/api/v1/statuses/${post_id}`;
const data = await fetch(url, {
method: 'POST',
headers: { "Authorization": `Bearer ${token}` },
})
return await data.json()
}
/**
* GET /api/v1/statuses/{post_id}/context.
* @param {string} host - The domain of the target server.