1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-26 07:19:23 +00:00

Ready to implement comments deletion

This commit is contained in:
Pierre HUBERT 2020-03-20 19:07:19 +01:00
parent 66c545fc3d
commit 58c3930ceb
2 changed files with 15 additions and 0 deletions

View File

@ -28,6 +28,15 @@ export class CommentsHelper {
return results.map(this.DbToComment); 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 * Turn a database entry into a Comment object
* *

View File

@ -6,6 +6,7 @@ import { GroupsHelper } from "./GroupsHelper";
import { GroupMembershipLevels } from "../entities/GroupMember"; import { GroupMembershipLevels } from "../entities/GroupMember";
import { mysql_date } from "../utils/DateUtils"; import { mysql_date } from "../utils/DateUtils";
import { LikesHelper, LikesType } from "./LikesHelper"; import { LikesHelper, LikesType } from "./LikesHelper";
import { CommentsHelper } from "./CommentsHelper";
/** /**
* Posts helper * Posts helper
@ -488,6 +489,11 @@ export class PostsHelper {
// Delete all the likes associated with the post // Delete all the likes associated with the post
await LikesHelper.DeleteAll(postID, LikesType.POST); await LikesHelper.DeleteAll(postID, LikesType.POST);
// Delete all the comments associated to the post
await CommentsHelper.DeleteAll(postID);
// TODO : continue deletion
} }
/** /**