fix: 422 error on normal refresh — min query length violation
- Changed q=* to q=** in autocomplete.js and offline.js - Backend requires min_query_length=2, single * was 1 char → 422 - Caused blank page on F5 refresh (non-hard-refresh)
This commit is contained in:
@@ -314,7 +314,7 @@ function searchWikilinks(partial, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fetch('/api/search/advanced?q=*&vault=all&limit=500')
|
fetch('/api/search/advanced?q=**&vault=all&limit=500')
|
||||||
.then(function(r) { return r.json(); })
|
.then(function(r) { return r.json(); })
|
||||||
.then(function(data) {
|
.then(function(data) {
|
||||||
_fileCache = (data.results || []).map(function(r) {
|
_fileCache = (data.results || []).map(function(r) {
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export async function syncFileIndexFromServer() {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
// Use a wildcard query to get recent files and populate offline index
|
// Use a wildcard query to get recent files and populate offline index
|
||||||
const resp = await fetch('/api/search/advanced?q=*&vault=all&limit=200');
|
const resp = await fetch('/api/search/advanced?q=**&vault=all&limit=200');
|
||||||
if (!resp.ok) {
|
if (!resp.ok) {
|
||||||
console.warn('[Offline] Index sync failed — API returned', resp.status);
|
console.warn('[Offline] Index sync failed — API returned', resp.status);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user