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; });