mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +00:00
added getPost
method to Post model
This commit is contained in:
parent
fda663d835
commit
b70f71e316
@ -11,6 +11,18 @@ export default class Post {
|
|||||||
return 1200
|
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 }) {
|
static async sendComment({ post_id, comment }) {
|
||||||
if (!post_id || !comment) {
|
if (!post_id || !comment) {
|
||||||
throw new Error("Post ID and/or comment are required")
|
throw new Error("Post ID and/or comment are required")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user