File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
actions/search-product-variant Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff 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} ;
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ export default {
117117 resourceKeys : [
118118 "metaobjectDefinitions" ,
119119 ] ,
120- labelKey : "name " ,
120+ labelKey : "type " ,
121121 prevContext,
122122 } ) ;
123123 } ,
You can’t perform that action at this time.
0 commit comments