From ab608ac2a1972e0f99245a6625acd36483ec7b0f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 4 Jun 2025 14:47:40 +0200 Subject: [PATCH] Bug 40067: Simplify code Signed-off-by: Jonathan Druart --- .../intranet-tmpl/prog/js/vue/components/Link.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Link.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Link.vue index 36d136cdda5..4e62d632606 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Link.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Link.vue @@ -38,12 +38,11 @@ export default { methods: { redirect(url) { const redirectParams = url ? url : this.to; - if (typeof redirectParams === "string") - window.location.href = this.formatUrl(redirectParams); - if (typeof redirectParams === "object") { - const url = this.handleQuery(redirectParams); - window.location.href = this.formatUrl(url); - } + window.location.href = this.formatUrl( + typeof redirectParams === "object" + ? this.handleQuery(redirectParams) + : redirectParams + ); }, formatUrl(url) { if (url.includes("http://") || url.includes("https://")) return url; -- 2.34.1