From 65ad29ea921683c1992735bc18ba80fbad4f4d3b Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Sun, 14 Apr 2024 17:02:40 -1000 Subject: [PATCH] fix: :bug: Fix pages using the wrong base URLs for API endpoints --- pages/[username]/[uuid].vue | 4 +--- pages/[username]/index.vue | 6 ++---- pages/register/index.vue | 9 ++------- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/pages/[username]/[uuid].vue b/pages/[username]/[uuid].vue index 93c1d8b..1db723d 100644 --- a/pages/[username]/[uuid].vue +++ b/pages/[username]/[uuid].vue @@ -23,10 +23,8 @@ if (!config) { const route = useRoute(); -const url = process.client ? config.http.base_url : config.http.url; - const data = await fetch( - new URL(`/api/v1/statuses/${route.params.uuid}`, url), + new URL(`/api/v1/statuses/${route.params.uuid}`, config.http.base_url), { headers: { Accept: "application/json", diff --git a/pages/[username]/index.vue b/pages/[username]/index.vue index 29998e7..3071e77 100644 --- a/pages/[username]/index.vue +++ b/pages/[username]/index.vue @@ -23,11 +23,9 @@ if (!config) { const route = useRoute(); -const url = process.client ? config.http.base_url : config.http.url; - const username = (route.params.username as string).replace("@", ""); -const id = await fetch(new URL(`/api/v1/accounts/search?q=${username}`, url), { +const id = await fetch(new URL(`/api/v1/accounts/search?q=${username}`, config.http.base_url), { headers: { Accept: "application/json", }, @@ -38,7 +36,7 @@ const id = await fetch(new URL(`/api/v1/accounts/search?q=${username}`, url), { let data = null; if (id && id.length > 0) { - data = await fetch(new URL(`/api/v1/accounts/${id[0].id}`, url), { + data = await fetch(new URL(`/api/v1/accounts/${id[0].id}`, config.http.base_url), { headers: { Accept: "application/json", }, diff --git a/pages/register/index.vue b/pages/register/index.vue index 562fede..7ea49b7 100644 --- a/pages/register/index.vue +++ b/pages/register/index.vue @@ -102,7 +102,6 @@