From 16f4ffceec590e9b0600ced1a4bf283bc2567a61 Mon Sep 17 00:00:00 2001 From: devbini Date: Fri, 25 Jul 2025 20:36:27 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Notification=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=ED=81=B4=EB=A6=AD=20=EC=8B=9C=20View=EA=B0=80=20=EB=8F=99?= =?UTF-8?q?=EC=9E=91=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8D=98=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 클릭 핸들러 추가 --- src/components/notification/CardContent.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/components/notification/CardContent.tsx b/src/components/notification/CardContent.tsx index 744ac31..d1c8e90 100644 --- a/src/components/notification/CardContent.tsx +++ b/src/components/notification/CardContent.tsx @@ -2,6 +2,8 @@ import { MouseEvent } from 'react'; import { Link } from 'react-router-dom'; +import { axiosInstance } from '@/services/axiosInstance'; + import { NOTIFICATION_ROUTE, NOTIFICATION_TYPE } from '@/constants'; import { useNotification } from '@/hooks'; import { Notification } from '@/types'; @@ -34,6 +36,18 @@ export default function CardContent({ notification }: CardContentProps) { return routeUrl?.replace('{id}', urls[0]).replace('{session}', urls[1]); }; + const handleLinkClick = async () => { + const urls = url.split(','); + + if (urls.length === 1) { + try { + await axiosInstance.post(`/posts/${url}/view`); + } catch (error) { + console.error('Post view 요청 실패:', error); + } + } + }; + return ( <>
@@ -66,6 +80,7 @@ export default function CardContent({ notification }: CardContentProps) { {buttonText && ( {buttonText}