(postId)
| 64 | |
| 65 | export async function getPost(postId) { |
| 66 | return (await getPostThread(postId)).post; |
| 67 | } |
| 68 | |
| 69 | export async function getPostObject(postId) { |
| 70 | const post = await getPost(postId); |
| 71 | if (!post) { |
| 72 | throw new Error("Post not found"); |
| 73 | } |
| 74 | |
| 75 | return post; |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Toggle like on a post or a comment. |
| 80 | */ |
| 81 | export async function toggleLikeContent(contentId) { |
| 82 | const requestBody = { |
no test coverage detected