Skip to content

Commit

Permalink
samples(tests): removed unused times. (#211)
Browse files Browse the repository at this point in the history
Co-authored-by: Benjamin E. Coe <bencoe@google.com>
  • Loading branch information
Arakel2811 and bcoe authored Sep 16, 2022
1 parent a3e4a55 commit 436240e
Showing 3 changed files with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -43,9 +43,6 @@ async function main(generatedProductId) {

// The time when the fulfillment updates are issued, used to prevent
// out-of-order updates on fulfillment information.
const addTime = {
seconds: Math.round(Date.now() / 1000),
};

//If set to true, and the product is not found, the fulfillment information will still be processed and retained for
// at most 1 day and processed once the product is created
@@ -57,7 +54,6 @@ async function main(generatedProductId) {
product,
type,
placeIds,
addTime,
allowMissing,
};

Original file line number Diff line number Diff line change
@@ -44,17 +44,13 @@ async function main(generatedProductId) {

// The time when the fulfillment updates are issued, used to prevent
// out-of-order updates on fulfillment information.
const removeTime = {
seconds: Math.round(Date.now() / 1000),
};

const callRemoveFulfillmentPlaces = async () => {
// Construct request
const request = {
product,
type,
placeIds,
removeTime,
};

console.log('Remove fulfillment request:', request);
5 changes: 0 additions & 5 deletions retail/interactive-tutorials/product/set-inventory.js
Original file line number Diff line number Diff line change
@@ -54,9 +54,6 @@ async function main(generatedProductId) {

// The time when the request is issued, used to prevent
// out-of-order updates on inventory fields with the last update time recorded.
let setTime = {
seconds: Math.round(Date.now() / 1000),
};

// If set to true, and the product with name is not found, the
// inventory update will still be processed and retained for at most 1 day until the product is created
@@ -66,7 +63,6 @@ async function main(generatedProductId) {
// Construct request
const request = {
inventory: product,
setTime,
allowMissing,
};
console.log('Set inventory request:', request);
@@ -90,7 +86,6 @@ async function main(generatedProductId) {

// Set inventory with outdated time
product.priceInfo.price = 20.0;
setTime = {seconds: Math.round(Date.now() / 1000) - 86400};
await callSetInventory();

// Get product

0 comments on commit 436240e

Please sign in to comment.