Skip to content

Commit

Permalink
samples: GRST-149 set inventory tutorial add created product detailed…
Browse files Browse the repository at this point in the history
… log (#202)

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 #<issue_number_goes_here> 🦕
  • Loading branch information
Arakel2811 authored Aug 23, 2022
1 parent bf2e326 commit 7db53cb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions retail/interactive-tutorials/setup/setup-cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
};

Expand Down

0 comments on commit 7db53cb

Please sign in to comment.