Skip to content

Commit

Permalink
Merge pull request #643 from amansinghbais/#642
Browse files Browse the repository at this point in the history
Improved: passing productId for backend compatibility in the addProduct api (#642)
  • Loading branch information
ravilodhi authored Jan 20, 2025
2 parents d3906ad + 32345e7 commit 28e6de8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/views/AssignedDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}]
})
Expand Down
7 changes: 6 additions & 1 deletion src/views/DraftDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
Expand Down Expand Up @@ -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"
}];
}
Expand Down
3 changes: 3 additions & 0 deletions src/views/HardCountDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}]
})
Expand Down
3 changes: 3 additions & 0 deletions src/views/PendingReviewDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}]
})
Expand Down

0 comments on commit 28e6de8

Please sign in to comment.