File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export default function MemberCard({
2424
2525 const preventLinkAction = ( e : React . MouseEvent ) => {
2626 e . preventDefault ( ) ;
27- e . stopPropagation
27+ e . stopPropagation ( ) ;
2828 }
2929 return (
3030 < Card
Original file line number Diff line number Diff line change 77 AiFillHeart ,
88 AiOutlineHeart ,
99} from "react-icons/ai" ;
10+ import { toast } from "react-toastify" ;
1011
1112type Props = {
1213 targetId : string ;
@@ -20,8 +21,12 @@ export default function LikeButton({
2021 const router = useRouter ( ) ;
2122
2223 async function toggleLike ( ) {
23- await toggleLikeMember ( targetId , hasLiked ) ;
24- router . refresh ( ) ;
24+ try {
25+ await toggleLikeMember ( targetId , hasLiked ) ;
26+ router . refresh ( ) ;
27+ } catch {
28+ toast . error ( "Failed to update like. Please try again." ) ;
29+ }
2530 }
2631
2732 return (
You can’t perform that action at this time.
0 commit comments