Browse Source

fix(admin-ui): Fix ShippingMethod update error with falsy config values

Fixes #1800
Michael Bromley 3 years ago
parent
commit
0484053f3d

+ 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) {
+            if (!formValue == null) {
                 throw new Error(`Cannot find an argument value for the key "${name}"`);
             }
             return {

+ 2 - 0
packages/admin-ui/src/lib/settings/src/components/shipping-method-detail/shipping-method-detail.component.ts

@@ -241,6 +241,8 @@ export class ShippingMethodDetailComponent
                     this.changeDetector.markForCheck();
                 },
                 err => {
+                    // tslint:disable-next-line:no-console
+                    console.error(err);
                     this.notificationService.error(_('common.notify-update-error'), {
                         entity: 'ShippingMethod',
                     });