From 72fd648576f54536d85628ccf99ff3d588d1d968 Mon Sep 17 00:00:00 2001 From: Mike Murray Date: Thu, 26 Sep 2019 11:15:19 -0700 Subject: [PATCH 1/2] fix: key for `newMetafield` was incorrectly camel-cased Signed-off-by: Mike Murray --- .../included/product-admin/client/hocs/withProductForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/plugins/included/product-admin/client/hocs/withProductForm.js b/imports/plugins/included/product-admin/client/hocs/withProductForm.js index e2ea79f7f63..e79bab9cb2a 100644 --- a/imports/plugins/included/product-admin/client/hocs/withProductForm.js +++ b/imports/plugins/included/product-admin/client/hocs/withProductForm.js @@ -116,7 +116,7 @@ const wrapComponent = (Comp) => { } this.setState({ - newMetaField: { + newMetafield: { key: "", value: "" } From a13d3d47d10d58c73ec418ff2bed54769634b18f Mon Sep 17 00:00:00 2001 From: Mike Murray Date: Thu, 26 Sep 2019 11:16:32 -0700 Subject: [PATCH 2/2] fix: add meteor call for removing metafield Signed-off-by: Mike Murray --- .../included/product-admin/client/hocs/withProductForm.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/imports/plugins/included/product-admin/client/hocs/withProductForm.js b/imports/plugins/included/product-admin/client/hocs/withProductForm.js index e79bab9cb2a..54abc9cfe45 100644 --- a/imports/plugins/included/product-admin/client/hocs/withProductForm.js +++ b/imports/plugins/included/product-admin/client/hocs/withProductForm.js @@ -123,10 +123,8 @@ const wrapComponent = (Comp) => { }); } - handleMetaRemove = (event, metafield, index) => { - if (this.props.onMetaRemove) { - this.props.onMetaRemove(this.product._id, metafield, index); - } + handleMetaRemove = (event, metafield) => { + Meteor.call("products/removeMetaFields", this.product._id, metafield); } get product() {