fix: cells not found

- change: disable log health check websocket

Signed-off-by: pakintada@gmail.com <Pakin>
This commit is contained in:
pakintada@gmail.com 2026-05-27 08:15:45 +07:00
parent 79a76f5c3e
commit 244a234833
2 changed files with 14 additions and 7 deletions

View file

@ -4,18 +4,18 @@ import { lastRequestSheetPrice } from '../stores/recipeStore';
export interface PayloadFromSheet {
header: string[];
key: string;
payload: GristCell[];
payload?: GristCell[];
}
export interface GristCell {
cells: {
cells?: {
coord: {
col: number;
row: number;
};
value: string;
}[];
row_index: number;
row_index?: number;
}
const PRICE_SHEET_DEFINITION_BY_COUNTRY: any = {
@ -53,9 +53,13 @@ export function handleSheetResponseFromNoti(raw_payload: any, ref: string, count
let price_rows = c.payload;
// get last because last row will always override
let expected_row = price_rows[price_rows.length - 1];
let price_col = expected_row.cells[price_idx];
products[curr_product_code] = price_col;
console.log(`[handleSheetPrice][country] ${curr_product_code} --> ${price_col}`);
if (expected_row.cells != undefined) {
let price_col = expected_row.cells[price_idx];
products[curr_product_code] = price_col;
console.log(`[handleSheetPrice][country] ${curr_product_code} --> ${price_col}`);
} else {
console.log(`[handleSheetPrice][country] ${curr_product_code} not found cell`);
}
}
lastRequestSheetInstance[country ?? 'unknown'] = products;