actually working dimension fields!
This commit is contained in:
@ -671,6 +671,43 @@ export class Shop {
|
||||
return newItem
|
||||
}
|
||||
|
||||
SetInventoryItemWeight(item: shopify.InventoryItem, config: Config, weight: number, weight_unit: shopify.WeightUnit) {
|
||||
let gql = /* GraphQL */ `
|
||||
mutation inventoryItemUpdate($id: ID!, $input: InventoryItemInput!) {
|
||||
inventoryItemUpdate(id: $id, input: $input) {
|
||||
inventoryItem {
|
||||
id
|
||||
measurement {
|
||||
weight {
|
||||
value
|
||||
unit
|
||||
}
|
||||
}
|
||||
}
|
||||
userErrors {
|
||||
field
|
||||
message
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
let variables = {
|
||||
id: item.id,
|
||||
input: {
|
||||
measurement: {
|
||||
weight: {
|
||||
value: weight,
|
||||
unit: weight_unit
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
let query = buildGqlQuery(gql, variables)
|
||||
let response = this.shopifyGraphQLAPI(query)
|
||||
let newItem: shopify.InventoryItem = response.content
|
||||
return newItem
|
||||
}
|
||||
|
||||
shopifyAPI(endpoint: string, query: {}, next = "") {
|
||||
var options: GoogleAppsScript.URL_Fetch.URLFetchRequestOptions = {
|
||||
method: "get",
|
||||
|
||||
Reference in New Issue
Block a user