diff --git a/M01_MasterData/LogicBuilder/M01_LB_Api.ts b/M01_MasterData/LogicBuilder/M01_LB_Api.ts index c48f7d03c..3b63641c6 100644 --- a/M01_MasterData/LogicBuilder/M01_LB_Api.ts +++ b/M01_MasterData/LogicBuilder/M01_LB_Api.ts @@ -84,6 +84,24 @@ export function lbCalcLater( }, CALC_WAIT_MS); } +/** 기다림 없이 바로 셈(기대값 시험표처럼 여러 줄을 차례로) — `lbCalcLater` 의 최신만과 안 걸림. + * 서버에 못 닿으면 null · 멈춤(ok false)은 답 그대로 · 둘 다 `onPlain` 에 쉬운 말 */ +export async function lbCalcNow( + row: LogicRow, + inputs: Record, + tables: LbTables, + onPlain?: (plain: string) => void, +): Promise { + try { + const ans = await send("/calc", { row, inputs: inputsFor(row, inputs), tables }); + if (!ans.ok) onPlain?.(plainStop(ans.reason)); + return ans; + } catch (e: unknown) { + onPlain?.(plainError(e)); + return null; + } +} + /** 사용처 — 그 표를 쓰는 로직(표 「용도」 + 로직 글 대조) */ export async function tableUsers(key: string): Promise { const got = await send<{ users: LbTableUser[] }>(