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:
parent
9a0e746ebc
commit
c83d722c82
@ -76,6 +76,19 @@ export class CommentsController {
|
|||||||
h.success()
|
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
|
* Get the content of a comment included in a POST field
|
||||||
*
|
*
|
||||||
|
@ -211,6 +211,8 @@ export const Routes : Route[] = [
|
|||||||
|
|
||||||
{path: "/comments/edit", cb: (h) => CommentsController.Edit(h)},
|
{path: "/comments/edit", cb: (h) => CommentsController.Edit(h)},
|
||||||
|
|
||||||
|
{path: "/comments/delete", cb: (h) => CommentsController.Delete(h)},
|
||||||
|
|
||||||
|
|
||||||
// Notifications controller
|
// Notifications controller
|
||||||
{path: "/notifications/count_unread", cb: (h) => NotificationsController.CountUnread(h)},
|
{path: "/notifications/count_unread", cb: (h) => NotificationsController.CountUnread(h)},
|
||||||
|
Loading…
Reference in New Issue
Block a user