From 39943aa1e8347c94e1e983ba6315e8d99bdf5960 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Mon, 23 Dec 2024 14:51:04 +0530 Subject: [PATCH] Improved: reverted unwanted changes in countDetail and simplified cycleCount items fetching logic (#528) --- src/views/CountDetail.vue | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/views/CountDetail.vue b/src/views/CountDetail.vue index 488452c0..2d96b26d 100644 --- a/src/views/CountDetail.vue +++ b/src/views/CountDetail.vue @@ -295,8 +295,7 @@ const barcodeInput = ref(); let isScanningInProgress = ref(false); onIonViewDidEnter(async() => { - await fetchCycleCount(); - await fetchCycleCountItems(); + await Promise.allSettled([await fetchCycleCount(), store.dispatch("count/fetchCycleCountItems", { inventoryCountImportId : props?.id })]) selectedSegment.value = 'all'; queryString.value = ''; previousItem = itemsList.value[0] @@ -348,10 +347,6 @@ function inputCountValidation(event) { if(/[`!@#$%^&*()_+\-=\\|,.<>?~e]/.test(event.key) && event.key !== 'Backspace') event.preventDefault(); } -async function fetchCycleCountItems() { - await store.dispatch("count/fetchCycleCountItems", { inventoryCountImportId : props?.id }); -} - async function fetchCycleCount() { emitter.emit("presentLoader"); let payload = props?.id @@ -463,7 +458,6 @@ const onScroll = (event) => { previousItem = currentProduct // Update the previousItem variable with the current item if (currentProduct) { - const currentIndex = itemsList.value?.indexOf(currentProduct); store.dispatch("product/currentProduct", currentProduct); product.value.isRecounting = false; }