diff --git a/src/addons/browser/browser.ts b/src/addons/browser/browser.ts index 64034ab38..95a37b75d 100644 --- a/src/addons/browser/browser.ts +++ b/src/addons/browser/browser.ts @@ -1,5 +1,5 @@ import { writable } from "svelte/store"; -import { baseApiUrl } from "../../api/base.js"; +import { BASE_API_URL } from "@/config/config.js"; export const filter = writable("featured"); @@ -52,7 +52,7 @@ export function buildParams({ } export function buildUrl({ query = "", filters = {}, per_page = 5 }) { - const u = new URL("addons/", baseApiUrl); + const u = new URL("addons/", BASE_API_URL); u.search = new URLSearchParams({ query, diff --git a/src/routes/app/add-ons/+page.svelte b/src/routes/app/add-ons/+page.svelte index 6c76263b0..a43ced22f 100644 --- a/src/routes/app/add-ons/+page.svelte +++ b/src/routes/app/add-ons/+page.svelte @@ -11,11 +11,10 @@ import Star from "@/common/icons/Star.svelte"; import Credit from "@/common/icons/Credit.svelte"; import type { Page } from "@/api/types/common.js"; + import { onMount } from "svelte"; let per_page = 10; - export let data; - $: urlParams = buildParams({ per_page, query: $query, @@ -32,7 +31,7 @@ export async function load(url) { loading = true; - + console.log(url); res = await fetch(url, { credentials: "include", }) @@ -50,6 +49,7 @@ loading = false; } + onMount(() => load(url)); $: loadNext = () => load(next_url); $: loadPrev = () => load(previous_url); $: reload = () => load(url); diff --git a/src/routes/app/add-ons/+page.ts b/src/routes/app/add-ons/+page.ts index 1cbad8089..e69de29bb 100644 --- a/src/routes/app/add-ons/+page.ts +++ b/src/routes/app/add-ons/+page.ts @@ -1,8 +0,0 @@ -import { getAddons } from "@/lib/api/addons"; - -export async function load({ fetch }) { - const addons = getAddons(fetch); - return { - addons, - }; -}