Skip to content

Commit

Permalink
Fix: Incorrect Toast Message Displayed When User Accepts Counted Value
Browse files Browse the repository at this point in the history
  • Loading branch information
idk-mr4tyunjay committed Oct 19, 2024
1 parent 3d05506 commit e435297
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/views/PendingReviewDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -531,11 +531,23 @@ async function acceptItem(item?: any) {
const resp = await Promise.allSettled(payloads.map((payload: any) => CountService.acceptItem(payload)))
const isAnyRespHasError = resp.some((response: any) => response.status === "rejected")
if(isAnyRespHasError) {
showToast(translate("Some of the item(s) are failed to accept"))
const primary = (
getProductIdentificationValue(
productStoreSettings.value.productIdentificationPref.primaryId,
getProduct.value(item.productId)
)
);
const isAnyRespHasError = resp.some(
(response: any) => response.status === "rejected"
);
if (isAnyRespHasError) {
showToast(translate("Some of the item(s) are failed to accept"));
} else {
showToast(translate("All of the item(s) are accepted"))
if (payloads.length === 1) {
showToast(translate(`Item: ${primary} has been accepted`));
} else {
showToast(translate("All items have been accepted"));
}
}
await fetchCountItems()
}
Expand Down

0 comments on commit e435297

Please sign in to comment.