simplify and update onEdit columns
This commit is contained in:
@ -43,37 +43,24 @@ export function columnOnEditHandler(e: GoogleAppsScript.Events.SheetsOnEdit) {
|
||||
for (let row = e.range.getRow(); row <= e.range.getLastRow(); row++) {
|
||||
console.log("row: " + row)
|
||||
let updateString = "updating " + header + " on row " + row
|
||||
switch (header) {
|
||||
case "shopify_status":
|
||||
let shopifyUpdateColumns = [
|
||||
"shopify_status",
|
||||
"title",
|
||||
"product_type",
|
||||
"tags",
|
||||
"description",
|
||||
"base_price",
|
||||
"original_price",
|
||||
"weight_grams",
|
||||
"product_height_cm",
|
||||
"product_width_cm",
|
||||
"product_depth_cm"
|
||||
]
|
||||
if (shopifyUpdateColumns.includes(header)) {
|
||||
// Accumulate changes for 30s before updating
|
||||
toastAndLog(updateString)
|
||||
updateProductToShopify(row)
|
||||
break
|
||||
case "title":
|
||||
toastAndLog(updateString)
|
||||
updateProductToShopify(row)
|
||||
break
|
||||
case "product_type":
|
||||
toastAndLog(updateString)
|
||||
updateProductToShopify(row)
|
||||
break
|
||||
case "tags":
|
||||
toastAndLog(updateString)
|
||||
updateProductToShopify(row)
|
||||
break
|
||||
case "description":
|
||||
toastAndLog(updateString)
|
||||
updateProductToShopify(row)
|
||||
break
|
||||
case "price":
|
||||
toastAndLog(updateString)
|
||||
updateProductToShopify(row)
|
||||
break
|
||||
case "compare_at_price":
|
||||
toastAndLog(updateString)
|
||||
updateProductToShopify(row)
|
||||
break
|
||||
default:
|
||||
continue
|
||||
}
|
||||
toastAndLog("completed " + updateString)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user