Engage endpoint
This commit is contained in:
parent
6fcbb92691
commit
d93dc7fd89
4 changed files with 73 additions and 0 deletions
|
|
@ -126,3 +126,18 @@ export async function submitLogin(
|
|||
|
||||
if (response.ok) return await response.json();
|
||||
}
|
||||
/**
|
||||
* Engage with a post.
|
||||
* @param postId The id of the post to engage with.
|
||||
* @param token The token of the user engaging with the post.
|
||||
* @returns {Promise<Response>} A promise that resolves to a Response object.
|
||||
*/
|
||||
export async function engage(postId: string, token: string): Promise<Response> {
|
||||
return await fetch(`/api/posts/${postId}/engage`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue