added getPost method to Post model

This commit is contained in:
srgooglo 2022-10-06 21:46:08 +02:00
parent fda663d835
commit b70f71e316

View File

@ -11,6 +11,18 @@ export default class Post {
return 1200
}
static async getPost({ post_id }) {
if (!post_id) {
throw new Error("Post ID is required")
}
const request = Post.bridge.get.post(undefined, {
post_id,
})
return request
}
static async sendComment({ post_id, comment }) {
if (!post_id || !comment) {
throw new Error("Post ID and/or comment are required")