From 8fa0b02413e4a98f9fcc97e1aae1d2d086c9799f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Diot?= Date: Wed, 7 Aug 2024 16:40:25 +0100 Subject: [PATCH] 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. --- src/ui/client/dashboard/pages/logs/Logs.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ui/client/dashboard/pages/logs/Logs.vue b/src/ui/client/dashboard/pages/logs/Logs.vue index 785a03053..f53f7455c 100644 --- a/src/ui/client/dashboard/pages/logs/Logs.vue +++ b/src/ui/client/dashboard/pages/logs/Logs.vue @@ -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, ); }