From 7db53cb746a699b4ecc699fc889d9d56c1d488c6 Mon Sep 17 00:00:00 2001 From: Arakel2811 <38522242+Arakel2811@users.noreply.github.com> Date: Tue, 23 Aug 2022 20:50:17 +0400 Subject: [PATCH] samples: GRST-149 set inventory tutorial add created product detailed log (#202) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/nodejs-retail/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes # 🦕 --- retail/interactive-tutorials/setup/setup-cleanup.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/retail/interactive-tutorials/setup/setup-cleanup.js b/retail/interactive-tutorials/setup/setup-cleanup.js index b011993d81..745243f9ee 100644 --- a/retail/interactive-tutorials/setup/setup-cleanup.js +++ b/retail/interactive-tutorials/setup/setup-cleanup.js @@ -71,6 +71,16 @@ const createProduct = async ( // Run request const response = await retailClient.createProduct(request); console.log(`Product ${response[0].id} created`); + + const createdProduct = {}; + createdProduct.id = response[0].id; + createdProduct.name = response[0].name; + createdProduct.priceInfo = response[0].priceInfo; + createdProduct.fulfillmentInfo = response[0].fulfillmentInfo; + createdProduct.availableQuantity = response[0].availableQuantity; + createdProduct.availability = response[0].availability; + console.log('Created product: ', createdProduct); + return response[0]; };