first test on ajax
This commit is contained in:
@@ -90,14 +90,16 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
try {
|
||||
// REPLACE THIS URL with your actual endpoint
|
||||
// const response = await fetch(`/api/search?q=${encodeURIComponent(query)}&limit=${filters.maxResults}`);
|
||||
// const data = await response.json();
|
||||
const response = await fetch(`/pexpo/v1/query?q=${encodeURIComponent(query)}&limit=${filters.maxResults}`);
|
||||
const data = await response.json();
|
||||
|
||||
// --- SIMULATED FETCH FOR DEMO (Remove this block in production) ---
|
||||
await new Promise(r => setTimeout(r, 600)); // Fake network delay
|
||||
const data = simulateBackendResponse(query);
|
||||
// await new Promise(r => setTimeout(r, 600)); // Fake network delay
|
||||
// const data = simulateBackendResponse(query);
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
console.log(data);
|
||||
|
||||
results = data;
|
||||
|
||||
// 2. Compute local relevance if the API doesn't return it
|
||||
|
||||
Reference in New Issue
Block a user