diff --git a/src/helpers/CommentsHelper.ts b/src/helpers/CommentsHelper.ts index 0a092ee..2d99428 100644 --- a/src/helpers/CommentsHelper.ts +++ b/src/helpers/CommentsHelper.ts @@ -28,6 +28,15 @@ export class CommentsHelper { return results.map(this.DbToComment); } + /** + * Delete all the comments associated to a post + * + * @param postID Target post ID + */ + public static async DeleteAll(postID: number) { + // TODO : implement + } + /** * Turn a database entry into a Comment object * diff --git a/src/helpers/PostsHelper.ts b/src/helpers/PostsHelper.ts index bf76a3c..22bb247 100644 --- a/src/helpers/PostsHelper.ts +++ b/src/helpers/PostsHelper.ts @@ -6,6 +6,7 @@ import { GroupsHelper } from "./GroupsHelper"; import { GroupMembershipLevels } from "../entities/GroupMember"; import { mysql_date } from "../utils/DateUtils"; import { LikesHelper, LikesType } from "./LikesHelper"; +import { CommentsHelper } from "./CommentsHelper"; /** * Posts helper @@ -488,6 +489,11 @@ export class PostsHelper { // Delete all the likes associated with the post await LikesHelper.DeleteAll(postID, LikesType.POST); + + // Delete all the comments associated to the post + await CommentsHelper.DeleteAll(postID); + + // TODO : continue deletion } /**