mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-12-28 14:38:52 +00:00
Ready to implement post deletion
This commit is contained in:
parent
627600685d
commit
dfd36ac4e5
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user