-import { onMounted, onUnmounted, reactive } from 'vue';
+import { onMounted, onUnmounted, ref } from 'vue';
import {
fetchBasket,
removeItemFromBasket,
@@ -18,9 +18,7 @@ import { useCustomErrorHandler } from '@/shared/error-handler/use-custom-error-h
import { errorMessageFormat } from '@/shared/error-handler/error-message-format';
import { HttpError } from '@/shared/error-handler/custom-error';
-const state = reactive({
- showLoading: true,
-});
+const showLoading = ref(true);
const basketStore = useBasketStore();
const { getBasket, getAddedItem, getAddedItemId } = storeToRefs(basketStore);
@@ -103,7 +101,7 @@ const order = () => {
};
onMounted(async () => {
- state.showLoading = true;
+ showLoading.value = true;
try {
await fetchBasket();
} catch (error) {
@@ -130,7 +128,7 @@ onMounted(async () => {
},
);
} finally {
- state.showLoading = false;
+ showLoading.value = false;
}
});
@@ -141,8 +139,8 @@ onUnmounted(async () => {
-
-
+
+
{{ t('addedItemsToBasket') }}
diff --git a/samples/web-csr/dressca-frontend/consumer/src/views/catalog/CatalogView.vue b/samples/web-csr/dressca-frontend/consumer/src/views/catalog/CatalogView.vue
index b7fa0a52a..73ed79445 100644
--- a/samples/web-csr/dressca-frontend/consumer/src/views/catalog/CatalogView.vue
+++ b/samples/web-csr/dressca-frontend/consumer/src/views/catalog/CatalogView.vue
@@ -1,5 +1,5 @@