Refactor of dateOfCreation, Addition of edited check in frontend, Endpoint added for engagement on posts

This commit is contained in:
Hollgy 2024-03-12 18:57:14 +01:00
parent f9ef90e61f
commit cedb469105
2 changed files with 17 additions and 1 deletions

View file

@ -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,