Generated API Docs using AI, Might edit later if there is an issue or it's hard to read. Finished API Functions

This commit is contained in:
Esad Mustafoski
2025-03-17 21:39:26 +01:00
parent 8b992017ba
commit 497d5aa28f
8 changed files with 749 additions and 49 deletions

View File

@@ -4,11 +4,12 @@
* @description API file for Posts
*/
// +++ IMPORTS ------------------------------------------------------ //
import * as db_utils from "../../database/utils.ts";
import * as helper_utils from "../helpers.ts";
import { Context } from "https://deno.land/x/oak@v17.1.2/mod.ts";
// Post functions
// +++ FUNCTIONS ----------------------------------------------------- //
async function api_getPostById(ctx: any): Promise<void> {
try {
const postId = ctx.params.id;
@@ -135,3 +136,11 @@ async function api_likePost(ctx: any): Promise<void> {
helper_utils.errorResponse(ctx, 500, "Error liking post");
}
}
export {
api_createPost,
api_deletePost,
api_getPostById,
api_likePost,
api_updatePost,
};