Browse Source

fix(admin-ui): Fix fix of ShippingMethod update error

Relates to #1800. The first "fix" contains an error in the negated `formValue`
expression. It is very lucky that the precedence of the `!` operator works on the
`formValue` first, otherwise the "fix" would have totally broken things way worse
than before! As it stands, it _did_ fix the issue in question but at the same time
broken the null check in a way that meant the `throw` statement could _never_ be reached.
Michael Bromley 3 năm trước cách đây
mục cha
commit
2367ab02c4

+ 1 - 1
packages/admin-ui/src/lib/core/src/common/utilities/configurable-operation-utils.ts

@@ -72,7 +72,7 @@ export function toConfigurableOperationInput(
         code: operation.code,
         arguments: operation.args.map(({ name, value }, j) => {
             const formValue = argsArray?.find(arg => arg.name === name)?.value ?? argsMap?.[name];
-            if (!formValue == null) {
+            if (formValue == null) {
                 throw new Error(`Cannot find an argument value for the key "${name}"`);
             }
             return {