parent
244a234833
commit
8b0479bf58
1 changed files with 7 additions and 2 deletions
|
|
@ -51,14 +51,19 @@ export function handleSheetResponseFromNoti(raw_payload: any, ref: string, count
|
||||||
// price idx should be last
|
// price idx should be last
|
||||||
let price_idx = header_idx[header_idx.length - 1];
|
let price_idx = header_idx[header_idx.length - 1];
|
||||||
let price_rows = c.payload;
|
let price_rows = c.payload;
|
||||||
|
if (!price_rows) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// get last because last row will always override
|
// get last because last row will always override
|
||||||
let expected_row = price_rows[price_rows.length - 1];
|
let expected_row = price_rows[price_rows.length - 1];
|
||||||
if (expected_row.cells != undefined) {
|
if (expected_row != undefined && expected_row.cells != undefined) {
|
||||||
let price_col = expected_row.cells[price_idx];
|
let price_col = expected_row.cells[price_idx];
|
||||||
products[curr_product_code] = price_col;
|
products[curr_product_code] = price_col;
|
||||||
console.log(`[handleSheetPrice][country] ${curr_product_code} --> ${price_col}`);
|
console.log(`[handleSheetPrice][country] ${curr_product_code} --> ${price_col}`);
|
||||||
} else {
|
} else {
|
||||||
console.log(`[handleSheetPrice][country] ${curr_product_code} not found cell`);
|
console.log(
|
||||||
|
`[handleSheetPrice][country] ${curr_product_code} not found cell, ${JSON.stringify(price_rows)}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue