use installed triggers

cannot call external services from default triggers
This commit is contained in:
Ben Miller
2024-11-14 00:50:05 -07:00
parent a5c0a1176d
commit 9b01d6de8a
3 changed files with 34 additions and 5 deletions

View File

@ -2,6 +2,7 @@ import { getShopifyProducts, runShopifyOrders } from "./shopifyApi"
import { fillProductFromTemplate } from "./fillProductFromTemplate"
import { createMissingPhotoFolders } from "./createMissingPhotoFolders"
import { matchProductToShopify } from "./match"
import { reinstallTriggers } from "./triggers"
export function initMenu() {
let ui = SpreadsheetApp.getUi()
@ -20,6 +21,13 @@ export function initMenu() {
.addItem("Run Shopify Orders", runShopifyOrders.name)
.addItem("Get Shopify Products", getShopifyProducts.name)
)
.addSeparator()
.addSubMenu(
ui
.createMenu("Utilities...")
.addItem("Reauthorize script", reauthorizeScript.name)
.addItem("Reinstall triggers", reinstallTriggers.name)
)
.addToUi()
}
@ -32,3 +40,7 @@ export function matchProductToShopifyHandler() {
let row = SpreadsheetApp.getCurrentCell().getRow()
matchProductToShopify(row)
}
export function reauthorizeScript() {
ScriptApp.invalidateAuth()
}