diff --git a/api/search_products.php b/api/search_products.php index 22b6e8d..616052d 100644 --- a/api/search_products.php +++ b/api/search_products.php @@ -24,7 +24,7 @@ try { } // Minimum query length to reduce load/noise - if (mb_strlen($q, 'UTF-8') < 2) { + if (mb_strlen($q, 'UTF-8') < 1) { echo json_encode(['items' => []], JSON_UNESCAPED_UNICODE); exit; } diff --git a/assets/js/search-autocomplete.js b/assets/js/search-autocomplete.js index 565b731..ea1da7c 100644 --- a/assets/js/search-autocomplete.js +++ b/assets/js/search-autocomplete.js @@ -147,7 +147,7 @@ var debounced = debounce(function () { var q = (input.value || '').trim(); - if (q.length < 2) { + if (q.length < 1) { close(); return; } @@ -158,7 +158,7 @@ input.addEventListener('focus', function () { var q = (input.value || '').trim(); - if (q.length >= 2) { + if (q.length >= 1) { fetchResults(q); } }); diff --git a/compcards.php b/compcards.php index 211f545..081bc84 100644 --- a/compcards.php +++ b/compcards.php @@ -20,14 +20,6 @@ $conn = db_connect(); $searchTerm = isset($_GET['search']) ? trim((string)$_GET['search']) : ''; $searchLen = function_exists('mb_strlen') ? mb_strlen($searchTerm, 'UTF-8') : strlen($searchTerm); if ($searchTerm !== '') { - if ($searchLen < 2) { - ?>
-

Suchergebnisse für „

-

Bitte geben Sie mindestens 2 Zeichen ein.

-