diff --git a/retail/interactive-tutorials/product/add-fulfillment-places.js b/retail/interactive-tutorials/product/add-fulfillment-places.js index dcb9972a96..97dbfc290a 100644 --- a/retail/interactive-tutorials/product/add-fulfillment-places.js +++ b/retail/interactive-tutorials/product/add-fulfillment-places.js @@ -66,7 +66,8 @@ async function main(generatedProductId) { console.log('Add fulfillment request:', request); // Run request - await retailClient.addFulfillmentPlaces(request); + const [operation] = await retailClient.addFulfillmentPlaces(request); + await operation.promise(); console.log('Waiting to complete add operation..'); }; @@ -74,7 +75,6 @@ async function main(generatedProductId) { // Add fulfillment places with current time console.log('Start add fulfillment'); await calladdFulfillmentPlaces(); - await utils.delay(180000); //Get product const response = await utils.getProduct(product); diff --git a/retail/interactive-tutorials/product/remove-fulfillment-places.js b/retail/interactive-tutorials/product/remove-fulfillment-places.js index 217a72b9ab..a6b3756f04 100644 --- a/retail/interactive-tutorials/product/remove-fulfillment-places.js +++ b/retail/interactive-tutorials/product/remove-fulfillment-places.js @@ -61,7 +61,8 @@ async function main(generatedProductId) { console.log('Remove fulfillment request:', request); // Run request - await retailClient.removeFulfillmentPlaces(request); + const [operation] = await retailClient.removeFulfillmentPlaces(request); + await operation.promise(); console.log('Waiting to complete remove operation..'); }; @@ -69,7 +70,6 @@ async function main(generatedProductId) { // Remove fulfillment places with current time console.log('Start remove fulfillment'); await callRemoveFulfillmentPlaces(); - await utils.delay(180000); //Get product const response = await utils.getProduct(product); diff --git a/retail/interactive-tutorials/product/set-inventory.js b/retail/interactive-tutorials/product/set-inventory.js index 1b849cebdc..79083cad8d 100644 --- a/retail/interactive-tutorials/product/set-inventory.js +++ b/retail/interactive-tutorials/product/set-inventory.js @@ -74,14 +74,14 @@ async function main(generatedProductId) { console.log('Set inventory request:', request); // Run request - await retailClient.setInventory(request); + const [operation] = await retailClient.setInventory(request); + await operation.promise(); console.log('Waiting to complete set inventory operation..'); }; // Set inventory with current time console.log('Start set inventory'); await callSetInventory(); - await utils.delay(200000); // Get product let changedProduct = await utils.getProduct(createdProduct.name); @@ -94,7 +94,6 @@ async function main(generatedProductId) { product.priceInfo.price = 20.0; setTime = {seconds: Math.round(Date.now() / 1000) - 86400}; await callSetInventory(); - await utils.delay(200000); // Get product changedProduct = await utils.getProduct(createdProduct.name);