mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-03 19:14:03 +00:00 
			
		
		
		
	Can delete a comment
This commit is contained in:
		@@ -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)},
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user