1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-25 14:59:22 +00:00

Can delete a comment

This commit is contained in:
Pierre HUBERT 2020-03-21 12:04:04 +01:00
parent 9a0e746ebc
commit c83d722c82
2 changed files with 15 additions and 0 deletions

View File

@ -76,6 +76,19 @@ export class CommentsController {
h.success()
}
/**
* Delete a comment
*
* @param h Request handler
*/
public static async Delete(h: RequestHandler) {
const commentID = await this.GetPostCommentIDWithFullAccess(h, "commentID");
await CommentsHelper.Delete(await CommentsHelper.GetSingle(commentID));
h.success();
}
/**
* Get the content of a comment included in a POST field
*

View File

@ -211,6 +211,8 @@ export const Routes : Route[] = [
{path: "/comments/edit", cb: (h) => CommentsController.Edit(h)},
{path: "/comments/delete", cb: (h) => CommentsController.Delete(h)},
// Notifications controller
{path: "/notifications/count_unread", cb: (h) => NotificationsController.CountUnread(h)},