1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-22 13:29:22 +00:00

Ready to implement post deletion

This commit is contained in:
Pierre HUBERT 2020-03-20 18:47:28 +01:00
parent 627600685d
commit dfd36ac4e5
3 changed files with 24 additions and 0 deletions

View File

@ -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
*

View File

@ -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

View File

@ -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
*