From b8c7a80f9ab48ad81483d16472769f9b236160f6 Mon Sep 17 00:00:00 2001 From: arkohut <39525455+arkohut@users.noreply.github.com> Date: Sun, 7 Jul 2024 12:33:35 +0800 Subject: [PATCH] fix(web): update url --- web/src/routes/+page.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/routes/+page.svelte b/web/src/routes/+page.svelte index 207f321..68468df 100644 --- a/web/src/routes/+page.svelte +++ b/web/src/routes/+page.svelte @@ -13,6 +13,8 @@ let selectedImage = 0; const debounceDelay = 300; + const apiEndpoint = + typeof PUBLIC_API_ENDPOINT !== 'undefined' ? PUBLIC_API_ENDPOINT : window.location.origin; /** * @param {string} query @@ -21,7 +23,6 @@ isLoading = true; try { - const apiEndpoint = typeof PUBLIC_API_ENDPOINT !== 'undefined' ? PUBLIC_API_ENDPOINT : window.location.origin; const response = await fetch(`${apiEndpoint}/search?q=${encodeURIComponent(query)}`); if (!response.ok) { throw new Error('Network response was not ok'); @@ -141,7 +142,7 @@ {#if searchResults.length && showModal}