From bf4e6956768a666bd6d349fdb936225060cb450e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B3=E5=85=83=E7=9A=93?= Date: Mon, 23 Jun 2025 01:10:24 +0800 Subject: [PATCH] =?UTF-8?q?What=20is=20this=3F=20undefined:undefined=3F=20?= =?UTF-8?q?A=20recipe=20for=20debugging=20hell.=20(I=20used=20GitHub=20Cop?= =?UTF-8?q?ilot=20for=20this=20debugging=20session.),=20Also=20changes=20s?= =?UTF-8?q?ome=20broken=20stuff=20like=20const=20res=20=3D=20req.json()=20?= =?UTF-8?q?req.status=20=3D=3D=3D=20"success",=20what=20even=20is=20that?= =?UTF-8?q?=20=F0=9F=99=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/app/windows/newsView.vue | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/components/app/windows/newsView.vue b/components/app/windows/newsView.vue index 5e37e3b..1fbb11a 100644 --- a/components/app/windows/newsView.vue +++ b/components/app/windows/newsView.vue @@ -108,17 +108,18 @@ const aiSummary = async () => { }; const starArticle = async () => { - const req = await fetch(`/user/${slug}/fav`); + const buildUrl = `/user/${slug}/fav`; + const req = await fetch(buildUrl); const res = await req.json(); - if (req.status === success) { - staredStatus.value = req.starred; + if (res.status === "success") { + staredStatus.value = res.starred; } }; onMounted(async () => { const req = await fetch(`/user/${slug}/star`); const res = await req.json(); - staredStatus.value = req; + staredStatus.value = res; });