fix: 🐛 Fix pages using the wrong base URLs for API endpoints

This commit is contained in:
Jesse Wierzbinski 2024-04-14 17:02:40 -10:00
parent 7accd4c037
commit 65ad29ea92
No known key found for this signature in database
3 changed files with 5 additions and 14 deletions

View file

@ -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",

View file

@ -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",
},