fill in query from params

This commit is contained in:
Theis Pieter Hollebeek 2024-01-19 04:04:21 +01:00
parent 7d830830f6
commit cd6c8c88b5

View File

@ -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);