From cac4159ba6a10095ec9afc19603b53577f1ed559 Mon Sep 17 00:00:00 2001 From: Maxim Lyubimov Date: Thu, 14 Dec 2023 16:28:50 +0400 Subject: [PATCH] hotfix: Corrects logic when returning a catalog error --- frontend/src/pages/Apps.vue | 9 +++++++++ frontend/src/stores/apps.js | 3 +++ frontend/src/util/fetch.js | 5 ++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/Apps.vue b/frontend/src/pages/Apps.vue index 2ab83ed..a5fd618 100644 --- a/frontend/src/pages/Apps.vue +++ b/frontend/src/pages/Apps.vue @@ -129,6 +129,15 @@ + diff --git a/frontend/src/stores/apps.js b/frontend/src/stores/apps.js index 501fde7..bfe6b11 100644 --- a/frontend/src/stores/apps.js +++ b/frontend/src/stores/apps.js @@ -646,6 +646,9 @@ export const useAppsStore = defineStore('apps', () => { } flags.value.loadingInitial = false + }).catch(() => { + flags.value.loadingInitial = false + flags.value.fetchEnd = true }) } else { flags.value.loadingInitial = false diff --git a/frontend/src/util/fetch.js b/frontend/src/util/fetch.js index 05686b6..77ffb6a 100644 --- a/frontend/src/util/fetch.js +++ b/frontend/src/util/fetch.js @@ -153,9 +153,8 @@ async function fetchAppsShort (params) { }) }).catch((error) => { if (error.code !== 'ERR_CANCELED') { - const data = error.response.data.detail - if (data.code >= 400) { - throw new Error('Failed to fetch resources (' + data.code + ')') + if (error.response.status >= 400) { + throw new Error('Failed to fetch resources (' + error.response.status + ')') } } })