refactor: use CSV path instead of markdown file for spark tables
Switch the spark table resolution logic to use the direct path to the backing CSV file rather than attempting to parse the containing markdown file. This simplifies the lookup process and improves reliability. Also refactor `SparkTableMeta` to store rows as objects keyed by header instead of raw string arrays.
This commit is contained in:
@@ -127,8 +127,8 @@ export const JournalInput: Component = () => {
|
||||
try {
|
||||
const key = (parsed.payload as { key: string }).key;
|
||||
const match = comp.data.sparkTables.find((s) => s.slug === key);
|
||||
const filePath = match?.filePath ?? "";
|
||||
const p = await resolveSparkPayload({ key, filePath });
|
||||
const csvPath = match?.csvPath ?? "";
|
||||
const p = await resolveSparkPayload({ key, csvPath });
|
||||
const result = sendMessage("spark", p);
|
||||
const r = unwrap(result);
|
||||
finish(r.ok, r.err);
|
||||
|
||||
Reference in New Issue
Block a user