mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-10-30 17:14:43 +00:00 
			
		
		
		
	Ready to implement post deletion
This commit is contained in:
		| @@ -334,6 +334,19 @@ export class PostsController { | ||||
| 		h.success(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Delete a post | ||||
| 	 *  | ||||
| 	 * @param h Request handler | ||||
| 	 */ | ||||
| 	public static async DeletePost(h: RequestHandler) { | ||||
| 		const postID = await h.postPostIDWithAccess("postID", PostAccessLevel.INTERMEDIATE_ACCESS); | ||||
|  | ||||
| 		await PostsHelper.Delete(postID); | ||||
|  | ||||
| 		h.success(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Send multiple posts to the API | ||||
| 	 *  | ||||
|   | ||||
| @@ -198,6 +198,8 @@ export const Routes : Route[] = [ | ||||
|  | ||||
| 	{path: "/posts/update_content", cb: (h) => PostsController.UpdateContent(h)}, | ||||
|  | ||||
| 	{path: "/posts/delete", cb: (h) => PostsController.DeletePost(h)}, | ||||
|  | ||||
|  | ||||
|  | ||||
| 	// Notifications controller | ||||
|   | ||||
| @@ -478,6 +478,15 @@ export class PostsHelper { | ||||
| 		}) | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Delete a post | ||||
| 	 *  | ||||
| 	 * @param postID The ID of the post to delete | ||||
| 	 */ | ||||
| 	public static async Delete(postID: number) { | ||||
|  | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Turn a database entry into a row object | ||||
| 	 *  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user