Skip to content

Commit

Permalink
Improved: Added checks to allow receiving of items if it was not rece…
Browse files Browse the repository at this point in the history
…ived earlier. This is helpful when some of the items got failed and allowed to receive the remaining items.
  • Loading branch information
ravilodhi committed Oct 16, 2024
1 parent 4939910 commit 63d344b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/store/modules/shipment/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ const actions: ActionTree<ShipmentState, RootState> = {
const params = {
"configId": "RECEIVE_SHIP_ITEMS"
}
if(!payload.isMultiReceivingEnabled) {
payload.items = payload.items.filter((item: any) => item.quantityReceived === 0)
}
const uploadData = payload.items.map((item: any) => {
return {
shipmentId: payload.shipmentId,
Expand All @@ -171,7 +174,6 @@ const actions: ActionTree<ShipmentState, RootState> = {
if (resp.status == 200 && !hasError(resp)) {
const uploadFileContentId = resp.data.uploadFileContentId;
if (uploadFileContentId) {
console.log("=========uploadFileContentId==", uploadFileContentId)
resp = await UploadService.fetchDataManagerLog({
"inputFields": {
"configId": "RECEIVE_SHIP_ITEMS",
Expand All @@ -183,7 +185,6 @@ const actions: ActionTree<ShipmentState, RootState> = {
"entityName": "DataManagerLog",
"viewSize": 1
});
console.log("=========resp==", resp)
if (!hasError(resp) && resp.data.docs.length) {
//If there is no error and file is processed then mark the shipment as received
resp = await ShipmentService.receiveShipment({
Expand Down

0 comments on commit 63d344b

Please sign in to comment.