mirror of
https://github.com/tcsenpai/pensieve.git
synced 2025-06-08 04:05:23 +00:00
fix(web): update url
This commit is contained in:
parent
3c66b9539d
commit
b8c7a80f9a
@ -13,6 +13,8 @@
|
|||||||
let selectedImage = 0;
|
let selectedImage = 0;
|
||||||
|
|
||||||
const debounceDelay = 300;
|
const debounceDelay = 300;
|
||||||
|
const apiEndpoint =
|
||||||
|
typeof PUBLIC_API_ENDPOINT !== 'undefined' ? PUBLIC_API_ENDPOINT : window.location.origin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} query
|
* @param {string} query
|
||||||
@ -21,7 +23,6 @@
|
|||||||
isLoading = true;
|
isLoading = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const apiEndpoint = typeof PUBLIC_API_ENDPOINT !== 'undefined' ? PUBLIC_API_ENDPOINT : window.location.origin;
|
|
||||||
const response = await fetch(`${apiEndpoint}/search?q=${encodeURIComponent(query)}`);
|
const response = await fetch(`${apiEndpoint}/search?q=${encodeURIComponent(query)}`);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error('Network response was not ok');
|
throw new Error('Network response was not ok');
|
||||||
@ -141,7 +142,7 @@
|
|||||||
|
|
||||||
{#if searchResults.length && showModal}
|
{#if searchResults.length && showModal}
|
||||||
<Figure
|
<Figure
|
||||||
image={`http://localhost:8080/files/${searchResults[selectedImage].filepath}`}
|
image={`${apiEndpoint}/files/${searchResults[selectedImage].filepath}`}
|
||||||
title={filename(searchResults[selectedImage].filepath)}
|
title={filename(searchResults[selectedImage].filepath)}
|
||||||
tags={searchResults[selectedImage].tags}
|
tags={searchResults[selectedImage].tags}
|
||||||
metadata_entries={searchResults[selectedImage].metadata_entries}
|
metadata_entries={searchResults[selectedImage].metadata_entries}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user