Refactor of dateOfCreation, Addition of edited check in frontend, Endpoint added for engagement on posts
This commit is contained in:
parent
f9ef90e61f
commit
cedb469105
2 changed files with 17 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ interface Votes {
|
|||
export interface Post extends NewPost {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
votes: Votes;
|
||||
}
|
||||
|
||||
|
|
@ -91,6 +92,15 @@ export async function getComments(
|
|||
return data;
|
||||
}
|
||||
|
||||
/** Incomplete */
|
||||
export async function engagePost(
|
||||
postId: string
|
||||
): Promise<void> {
|
||||
const res = await fetch(`/api/engage_post?post_id=${postId}`);
|
||||
const data = await res.json();
|
||||
return data;
|
||||
}
|
||||
|
||||
// Send the registration request to the server
|
||||
export async function submitRegistration(
|
||||
username: string,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue