TS API for deletePost
This commit is contained in:
parent
70ba521aa5
commit
6909dbd146
1 changed files with 11 additions and 0 deletions
|
@ -101,6 +101,17 @@ export async function getEngagementCount(postId: string): Promise<number> {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function deletePost(id: string, token: string): Promise<string> {
|
||||||
|
const r = await fetch(`/api/posts/${id}`, {
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return await r.json();
|
||||||
|
}
|
||||||
|
|
||||||
// Send the registration request to the server
|
// Send the registration request to the server
|
||||||
export async function submitRegistration(
|
export async function submitRegistration(
|
||||||
username: string,
|
username: string,
|
||||||
|
|
Loading…
Reference in a new issue