Skip to content

Commit

Permalink
Merge pull request #358 from ymaheshwari1/#357
Browse files Browse the repository at this point in the history
Fixed: payload to pass shipmentItemSeqId for externally added item for a shipment(#357)
  • Loading branch information
ravilodhi authored Mar 14, 2024
2 parents d2dc4e2 + e0736ad commit 3ec478c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/store/modules/shipment/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,16 @@ 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) commit(types.SHIPMENT_CURRENT_PRODUCT_ADDED, product)
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,
// when adding an item to shipment
commit(types.SHIPMENT_CURRENT_PRODUCT_ADDED, {
...product,
itemSeqId: resp.data.shipmentItemSeqId
})
}
return resp;
} else {
showToast(translate('Something went wrong'));
Expand Down

0 comments on commit 3ec478c

Please sign in to comment.