From 957c2d2901b641273979a29c29b3e27fe721ba4e Mon Sep 17 00:00:00 2001 From: Dat Date: Wed, 29 Jul 2026 16:22:08 +0200 Subject: [PATCH] feat(ui): Fix bug when redirecting hosting policy page --- .../Pages/HostingPolicy/HostingPolicyRenderer.vue | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/Pages/HostingPolicy/HostingPolicyRenderer.vue b/src/components/Pages/HostingPolicy/HostingPolicyRenderer.vue index 4c6b58db..b8dfe777 100644 --- a/src/components/Pages/HostingPolicy/HostingPolicyRenderer.vue +++ b/src/components/Pages/HostingPolicy/HostingPolicyRenderer.vue @@ -68,11 +68,15 @@ export default { if (this.isUpcomingRoute) { response = await this.$api.getUpcomingPolicyByType({ policyType }) } else if (this.isCurrentRoute) { - response = await this.$api.getCurrentPolicyByType({ policyType }) - if (response === undefined) { - // Special case to redirect users to the pilot policy if there is no current policy - // Remove afer T408316 - this.$router.replace({ path: '/hosting-policy/pilot' }) + // Special case to redirect users to the pilot policy if there is no current policy + // Remove afer T408316 + try { + response = await this.$api.getCurrentPolicyByType({ policyType }) + } catch (error) { + if (error && error.response && error.response.status === 404) { + this.$router.replace({ path: '/hosting-policy/pilot' }) + return + } } } else { response = await this.$api.getPolicyByDate({ policyType, activeFrom })