mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-12-28 14:38:52 +00:00
Ready to implement comments deletion
This commit is contained in:
parent
66c545fc3d
commit
58c3930ceb
@ -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
|
||||
*
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user