Skip to content

Commit

Permalink
Improved: code to remove the check for shipmentItemSeqId on receiving…
Browse files Browse the repository at this point in the history
… and added the same check when adding the product(#357)
  • Loading branch information
ymaheshwari1 committed Mar 13, 2024
1 parent a329e24 commit e0736ad
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/store/modules/shipment/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ const actions: ActionTree<ShipmentState, RootState> = {
return Promise.reject("Missing locationSeqId on item")
}

if(!item.itemSeqId) {
return Promise.reject("Missing shipmentItemSeqId on item")
}

const params = {
shipmentId: payload.shipmentId,
facilityId: this.state.user.currentFacility.facilityId,
Expand Down Expand Up @@ -157,7 +153,7 @@ const actions: ActionTree<ShipmentState, RootState> = {
locationSeqId: product.locationSeqId
}
const resp = await ShipmentService.addShipmentItem(params);
if(resp.status == 200 && !hasError(resp)){
if(resp.status == 200 && !hasError(resp) && resp.data.shipmentId && resp.data.shipmentItemSeqId) {
dispatch('updateProductCount', { shipmentId: resp.data.shipmentId })
if (!payload.shipmentId) {
// When adding item to a shipment from details page, then adding the shipmentItemSeqId to item level, as we do not generate shipmentItemSeqId app side,
Expand Down

0 comments on commit e0736ad

Please sign in to comment.