eprolo-cli 1.0.95 → 1.0.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/eprolo-cli.js +3 -3
- package/package.json +1 -1
package/bin/eprolo-cli.js
CHANGED
|
@@ -253,7 +253,7 @@ async function insertProduct(arg) {
|
|
|
253
253
|
info.optionList=optionList;
|
|
254
254
|
info.variantsList=variantsList;
|
|
255
255
|
info.imageList=imageList;
|
|
256
|
-
product.variants.forEach((variant,index)=>{
|
|
256
|
+
product.variants.edges.forEach((variant,index)=>{
|
|
257
257
|
let newInfo={
|
|
258
258
|
image_id:getId(variant.id),
|
|
259
259
|
title:variant.title,
|
|
@@ -263,14 +263,14 @@ async function insertProduct(arg) {
|
|
|
263
263
|
if(index==0){
|
|
264
264
|
optionList.push({name:option.name});
|
|
265
265
|
}
|
|
266
|
-
newInfo['
|
|
266
|
+
newInfo['option'+optionIndex]=option.name;
|
|
267
267
|
})
|
|
268
268
|
variantsList.push(newInfo);
|
|
269
269
|
})
|
|
270
270
|
product.media.edges.forEach((edge)=>{
|
|
271
271
|
imageList.push({src:edge.url,images_id:getId(edge.id)});
|
|
272
272
|
})
|
|
273
|
-
const data = await postJsonWithRetry(
|
|
273
|
+
const data = await postJsonWithRetry(BASE_URL+'/insert_product.html', info, config, "POST");
|
|
274
274
|
console.log(JSON.stringify(data, null, 2));
|
|
275
275
|
process.exit(0);
|
|
276
276
|
}
|
package/package.json
CHANGED