Skip to content

Commit

Permalink
chore: check if has dimension or weight value and set another one
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusgnreis authored Jul 6, 2024
1 parent f03687d commit c6abd9e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions functions/routes/ecom/modules/calculate-shipping.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ exports.post = async ({ appSdk }, req, res) => {
correiosParams: {
cepOrigem,
cepDestino,
psObjeto: pkg.weight.value || 500,
comprimento: pkg.dimensions.length.value || 16,
altura: pkg.dimensions.height.value || 2,
largura: pkg.dimensions.width.value || 11,
psObjeto: (pkg.weight.value > 0 ? pkg.weight.value : 500),
comprimento: (pkg.dimensions.length.value > 0 ? pkg.dimensions.length.value : 16),
altura: (pkg.dimensions.length.value > 0 ? pkg.dimensions.length.value : 2),
largura: (pkg.dimensions.length.value > 0 ? pkg.dimensions.length.value : 11),
vlDeclarado,
servicosAdicionais
},
Expand Down

0 comments on commit c6abd9e

Please sign in to comment.