|
|
@@ -62,7 +62,9 @@ const HomePage: React.FC = () => {
|
|
|
// 点赞帖子
|
|
|
const handleLike = async (postId: number) => {
|
|
|
try {
|
|
|
- await postClient[postId].like.$post();
|
|
|
+ await postClient[':id'].like.$post({
|
|
|
+ param: { id: postId }
|
|
|
+ });
|
|
|
setPosts(posts.map(post =>
|
|
|
post.id === postId ? { ...post, likesCount: post.likesCount + 1 } : post
|
|
|
));
|