From b2f66c513c2b7020394a230fd408850789f77771 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sun, 2 Jul 2023 21:15:31 +0800 Subject: [PATCH] fix subscribe --- .env.development | 2 +- src/components/cards/MediaCard.vue | 13 ++-- src/components/cards/SubscribeCard.vue | 90 +++++++++++++++++++++----- 3 files changed, 82 insertions(+), 23 deletions(-) diff --git a/.env.development b/.env.development index 64c2bdd4..b27eade5 100644 --- a/.env.development +++ b/.env.development @@ -1 +1 @@ -VITE_API_BASE_URL=http://10.10.10.10:3001/api/v1/ +VITE_API_BASE_URL=http://localhost:3001/api/v1/ diff --git a/src/components/cards/MediaCard.vue b/src/components/cards/MediaCard.vue index 6927d3e0..a7a42057 100644 --- a/src/components/cards/MediaCard.vue +++ b/src/components/cards/MediaCard.vue @@ -52,11 +52,14 @@ const removeSubscribe = async () => { let mediaid = props.media?.tmdb_id ? `tmdb:${props.media?.tmdb_id}` : `douban:${props.media?.douban_id}`; - const result: { [key: string]: any } = await api.delete(`subscribe/${mediaid}`, { - params: { - season: props.media?.season, - }, - }); + const result: { [key: string]: any } = await api.delete( + `subscribe/media/${mediaid}`, + { + params: { + season: props.media?.season, + }, + } + ); isSubscribed.value = !(result.success || false); } catch (error) { console.error(error); diff --git a/src/components/cards/SubscribeCard.vue b/src/components/cards/SubscribeCard.vue index 501ae07c..2da82bae 100644 --- a/src/components/cards/SubscribeCard.vue +++ b/src/components/cards/SubscribeCard.vue @@ -1,4 +1,5 @@