From 932ae204030c09276a0b3224a2c1e821d01443cd Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 21 Mar 2020 09:20:34 +0100 Subject: [PATCH] Ready to implement comments creation --- src/controllers/CommentsController.ts | 11 +++++++++++ src/controllers/Routes.ts | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/src/controllers/CommentsController.ts b/src/controllers/CommentsController.ts index cc84b70..e59f7ae 100644 --- a/src/controllers/CommentsController.ts +++ b/src/controllers/CommentsController.ts @@ -10,6 +10,17 @@ import { LikesHelper, LikesType } from "../helpers/LikesHelper"; export class CommentsController { + /** + * Create a new comment + * + * @param h Request handler + */ + public static async Create(h: RequestHandler) { + const postID = await h.postPostIDWithAccess("postID"); + + + } + /** * Turn a list of comment object into API entries diff --git a/src/controllers/Routes.ts b/src/controllers/Routes.ts index 14c5900..d53288e 100644 --- a/src/controllers/Routes.ts +++ b/src/controllers/Routes.ts @@ -12,6 +12,7 @@ import { CallsController } from "./CallsController"; import { FriendsController } from "./FriendsController"; import { MoviesController } from "./MoviesController"; import { PostsController } from "./PostsController"; +import { CommentsController } from "./CommentsController"; /** * Controllers routes @@ -203,6 +204,9 @@ export const Routes : Route[] = [ {path: "/posts/getAvailableTargets", cb: (h) => PostsController.GetTargets(h)}, + // Comments controller + {path: "/comments/create", cb: (h) => CommentsController.Create(h)}, + // Notifications controller {path: "/notifications/count_unread", cb: (h) => NotificationsController.CountUnread(h)},