From 807a6fa16ff3a79115d1391859f441b07012baa0 Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 8 Aug 2022 12:15:54 +0200 Subject: [PATCH] Updated tests --- src/App.vue | 2 +- src/components/SmartCard.vue | 5 +++++ src/composables/useNavigation.js | 2 +- src/pages/Login/Login.vue | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index 5e8edc84e..286bb5842 100644 --- a/src/App.vue +++ b/src/App.vue @@ -61,7 +61,7 @@ function responseError(error) { router.push({ path: '/login' }); } - return Promise.reject(error); + return Promise.resolve(error); } axios.interceptors.response.use((response) => response, responseError); diff --git a/src/components/SmartCard.vue b/src/components/SmartCard.vue index 04d487b69..4607994d6 100644 --- a/src/components/SmartCard.vue +++ b/src/components/SmartCard.vue @@ -60,6 +60,11 @@ async function fetch() { params: { filter }, }); + if (!data) { + isLoading.value = false; + return; + } + hasMoreData.value = data.length === rowsPerPage; for (const row of data) rows.value.push(row); diff --git a/src/composables/useNavigation.js b/src/composables/useNavigation.js index 45f4ea8f1..a5c58ec09 100644 --- a/src/composables/useNavigation.js +++ b/src/composables/useNavigation.js @@ -72,7 +72,7 @@ export function useNavigation() { event.stopPropagation(); const params = { moduleName: salixModules[moduleName] }; - const query = 'api/starredModules/toggleStarredModule'; + const query = 'StarredModules/toggleStarredModule'; await axios.post(query, params); updateFavorites(moduleName); diff --git a/src/pages/Login/Login.vue b/src/pages/Login/Login.vue index efeef7a13..850d598b1 100644 --- a/src/pages/Login/Login.vue +++ b/src/pages/Login/Login.vue @@ -22,6 +22,8 @@ async function onSubmit() { password: password.value, }); + if (!data) return; + await session.login(data.token, keepLogin.value); quasar.notify({