fix some methods having bad namings

This commit is contained in:
SrGooglo 2023-05-18 19:55:48 +00:00
parent 5c9ffb766c
commit 842266fdf8

View File

@ -50,7 +50,7 @@ export default class Post {
throw new Error("Post ID and/or comment are required") throw new Error("Post ID and/or comment are required")
} }
const request = await request({ const { data } = await request({
method: "POST", method: "POST",
url: `/comments/post/${post_id}`, url: `/comments/post/${post_id}`,
data: { data: {
@ -58,7 +58,7 @@ export default class Post {
}, },
}) })
return request return data
} }
static deleteComment = async ({ post_id, comment_id }) => { static deleteComment = async ({ post_id, comment_id }) => {
@ -66,12 +66,12 @@ export default class Post {
throw new Error("Post ID and/or comment ID are required") throw new Error("Post ID and/or comment ID are required")
} }
const request = await request({ const { data } = await request({
method: "DELETE", method: "DELETE",
url: `/comments/post/${post_id}/${comment_id}`, url: `/comments/post/${post_id}/${comment_id}`,
}) })
return request return data
} }
static getExplorePosts = async ({ trim, limit }) => { static getExplorePosts = async ({ trim, limit }) => {