From 1afa2d67c010a43e96545154628ba5af78f76963 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 01:11:11 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/settings.import.tsx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/routes/settings.import.tsx b/src/routes/settings.import.tsx index a9c64a5..31b4de7 100644 --- a/src/routes/settings.import.tsx +++ b/src/routes/settings.import.tsx @@ -930,6 +930,33 @@ function ImportPage() { const summary = { total: rawRows.length, inserted, skipped, errors, skipReasons }; setResults((r) => ({ ...r, [cfg.key]: summary })); + + // Persist run history (best-effort) + const runRow = { + importer_key: cfg.key, + total: rawRows.length, + inserted, + skipped, + error_count: errors.length, + ran_by: user.id, + }; + void supabase.from("import_runs" as any).insert(runRow as any).then(({ error: runErr }) => { + if (runErr) { + console.warn("[import] failed to record run", runErr); + return; + } + setLastRuns((prev) => ({ + ...prev, + [cfg.key]: { + ran_at: new Date().toISOString(), + total: rawRows.length, + inserted, + skipped, + error_count: errors.length, + }, + })); + }); + if (errors.length === 0) { const extra = mirrored > 0 ? ` (+${mirrored} mirrored to Clients)` : ""; toast.success(`${cfg.label}: ${inserted} imported${extra}`);