diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fac65e198..ff5575846 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,6 +43,7 @@ jobs: - name: Run lint run: | npm run lint + git diff --exit-code ./src jest-tests: runs-on: ubuntu-latest diff --git a/src/shipping/views/ShippingZoneDetails/data.ts b/src/shipping/views/ShippingZoneDetails/data.ts index b4d714ea6..809dd0d46 100644 --- a/src/shipping/views/ShippingZoneDetails/data.ts +++ b/src/shipping/views/ShippingZoneDetails/data.ts @@ -50,17 +50,17 @@ export function getUpdateShippingRateVariables( params: ShippingZoneUrlQueryParams, id: string ): UpdateShippingRateVariables { - const isPriceType = data.type === ShippingMethodTypeEnum.PRICE - const parsedMinValue = parseFloat(data.minValue) - const parsedMaxValue = parseFloat(data.maxValue) - const isPriceSet = !data.noLimits && isPriceType - const isWeightSet = !data.noLimits && !isPriceType + const isPriceType = data.type === ShippingMethodTypeEnum.PRICE; + const parsedMinValue = parseFloat(data.minValue); + const parsedMaxValue = parseFloat(data.maxValue); + const isPriceSet = !data.noLimits && isPriceType; + const isWeightSet = !data.noLimits && !isPriceType; return { id: params.id, input: { maximumOrderPrice: isPriceSet ? parsedMaxValue : null, maximumOrderWeight: isWeightSet ? parsedMaxValue : null, - minimumOrderPrice: isPriceSet ? parsedMinValue : null, + minimumOrderPrice: isPriceSet ? parsedMinValue : null, minimumOrderWeight: isWeightSet ? parsedMinValue : null, name: data.name, price: data.isFree ? 0 : parseFloat(data.price),