From cd6c8c88b517d8fc425aecb23a71cb46a602460f Mon Sep 17 00:00:00 2001 From: Theis Pieter Hollebeek Date: Fri, 19 Jan 2024 04:04:21 +0100 Subject: [PATCH] fill in query from params --- public/search/script.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/search/script.js b/public/search/script.js index e154ab0..165e7b6 100644 --- a/public/search/script.js +++ b/public/search/script.js @@ -30,6 +30,8 @@ function displayResponse(response) { function main() { const params = new URLSearchParams(window.location.search); + const searchElement = document.getElementById("query"); + searchElement.value = params.get("query") || ""; return fetch(`/api/search?${params.toString()}`) .then(v => v.json()) .then(displayResponse);