refactor: Update Logs.vue to use URLSearchParams for setting the 'file' parameter

The Logs.vue file has been updated to use the URLSearchParams API to set the 'file' parameter in the URL. This change improves the readability and maintainability of the code by using a built-in method for manipulating URL parameters.
This commit is contained in:
Théophile Diot 2024-08-07 16:40:25 +01:00
parent 1aae91f487
commit 8fa0b02413
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -42,11 +42,12 @@ function getLogContent() {
return;
const value = e.target.getAttribute("data-setting-value");
const url = `${location.href}/logs?file=${value}`;
const url = new URL(location.href);
url.searchParams.set("file", value);
// go to url
location.href = url;
},
true
true,
);
}