diff --git a/src/views/AssignedDetail.vue b/src/views/AssignedDetail.vue index e4715687..f7eedead 100644 --- a/src/views/AssignedDetail.vue +++ b/src/views/AssignedDetail.vue @@ -177,7 +177,10 @@ async function addProductToCount(productId: any) { const resp = await CountService.addProductToCount({ inventoryCountImportId: currentCycleCount.value.countId, itemList: [{ + // Passing both productId and idValue for the backend compatibility + // idValue will be removed in the future. idValue: productId, + productId, statusId: "INV_COUNT_CREATED" }] }) diff --git a/src/views/DraftDetail.vue b/src/views/DraftDetail.vue index 64504290..8f4b55c9 100644 --- a/src/views/DraftDetail.vue +++ b/src/views/DraftDetail.vue @@ -448,7 +448,9 @@ async function findProductFromIdentifier(payload: any) { return idValues.includes(identificationValue) && !itemsAlreadyInCycleCount.includes(product.productId); }) - const productsToAdd = filteredProducts.map((product: any) => ({ idValue: product.productId })); + // Passing both productId and idValue for the backend compatibility + // idValue will be removed in the future. + const productsToAdd = filteredProducts.map((product: any) => ({ idValue: product.productId, productId: product.productId })); if(!productsToAdd) { return showToast(translate("Failed to add product to count")) } @@ -482,7 +484,10 @@ async function addProductToCount(payload?: any) { itemList = payload.map((data: any) => ({ ...data, statusId: "INV_COUNT_CREATED" })); } else { itemList = [{ + // Passing both productId and idValue for the backend compatibility + // idValue will be removed in the future. idValue: searchedProduct.value.productId, + productId: searchedProduct.value.productId, statusId: "INV_COUNT_CREATED" }]; } diff --git a/src/views/HardCountDetail.vue b/src/views/HardCountDetail.vue index df4359f5..9687a020 100644 --- a/src/views/HardCountDetail.vue +++ b/src/views/HardCountDetail.vue @@ -456,7 +456,10 @@ async function addProductToCount(productId: any) { resp = await CountService.addProductToCount({ inventoryCountImportId: cycleCount.value.inventoryCountImportId, itemList: [{ + // Passing both productId and idValue for the backend compatibility + // idValue will be removed in the future. idValue: productId, + productId, statusId: "INV_COUNT_CREATED" }] }) diff --git a/src/views/PendingReviewDetail.vue b/src/views/PendingReviewDetail.vue index c3f7135c..0b85be49 100644 --- a/src/views/PendingReviewDetail.vue +++ b/src/views/PendingReviewDetail.vue @@ -300,7 +300,10 @@ async function addProductToCount(productId: any) { const resp = await CountService.addProductToCount({ inventoryCountImportId: currentCycleCount.value.countId, itemList: [{ + // Passing both productId and idValue for the backend compatibility + // idValue will be removed in the future. idValue: productId, + productId, statusId: "INV_COUNT_CREATED" }] })