Skip to content

Commit 0c6c374

Browse files
committed
updates
1 parent 80e0527 commit 0c6c374

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

components/shopify/actions/search-product-variant/search-product-variant.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ export default {
9696
throw new ConfigurationError("Required field missing: Fill in `Product Variant ID` or `Title`");
9797
}
9898

99+
let response;
99100
try {
100-
let response;
101101
if (this.productVariantId) {
102102
response = await this.shopify.getProductVariant({
103103
id: this.productVariantId,
@@ -122,15 +122,15 @@ export default {
122122
if (title && id) {
123123
$.export("$summary", `Found product variant \`${title}\` with ID \`${id}\``);
124124
} else {
125-
$.export("$summary", "No product variant found");
125+
throw new Error("No product variant found");
126126
}
127-
return response;
128127
} catch (err) {
129128
if (!this.createIfNotFound) {
130-
throw err;
129+
$.export("$summary", "No product variant found");
130+
return;
131131
}
132132

133-
let response = await this.shopify.createProductVariants({
133+
response = await this.shopify.createProductVariants({
134134
productId: this.productId,
135135
variants: [
136136
{
@@ -144,7 +144,7 @@ export default {
144144
throw new Error(response.productVariantsBulkCreate.userErrors[0].message);
145145
}
146146
$.export("$summary", `Created new product variant \`${response.productVariantsBulkCreate.productVariants.title}\` with ID \`${response.productVariantsBulkCreate.productVariants.id}\``);
147-
return response;
148147
}
148+
return response;
149149
},
150150
};

components/shopify/shopify.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export default {
117117
resourceKeys: [
118118
"metaobjectDefinitions",
119119
],
120-
labelKey: "name",
120+
labelKey: "type",
121121
prevContext,
122122
});
123123
},

0 commit comments

Comments
 (0)