1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-07-10 12:02:49 +00:00

Can get information about a single post

This commit is contained in:
2020-01-04 12:04:14 +01:00
parent 25159e3718
commit ddaa3a5a06
4 changed files with 93 additions and 0 deletions

@ -78,6 +78,19 @@ export class PostsController {
await this.SendMultiplePosts(h, posts);
}
/**
* Get information about a single post
*
* @param h Request handler
*/
public static async GetSingle(h: RequestHandler) {
const postID = await h.postPostIDWithAccess("postID");
const post = await PostsHelper.GetSingle(postID);
h.send(await this.PostToAPI(h, post));
}
/**
* Send multiple posts to the API

@ -190,6 +190,8 @@ export const Routes : Route[] = [
{path: "/posts/get_latest", cb: (h) => PostsController.GetLatest(h)},
{path: "/posts/get_single", cb: (h) => PostsController.GetSingle(h), needLogin: false},
// Notifications controller