Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
f64d5ac0c2
commit
7d946da7d0
@@ -578,6 +578,15 @@ function ImportPage() {
|
||||
const transformed = cfg.transform ? cfg.transform(row, ctx) : row;
|
||||
if (!transformed) { skipped++; continue; }
|
||||
|
||||
// archived → archived_at (only on tables that support it)
|
||||
if ("_archived" in transformed) {
|
||||
const flag = transformed._archived;
|
||||
delete transformed._archived;
|
||||
if (["clients", "cases", "contacts", "homeowners"].includes(cfg.table)) {
|
||||
transformed.archived_at = toBool(flag) ? new Date().toISOString() : null;
|
||||
}
|
||||
}
|
||||
|
||||
// required check
|
||||
const missing = cfg.required.find((k) => !transformed[k] && transformed[k] !== 0);
|
||||
if (missing) { skipped++; continue; }
|
||||
|
||||
Reference in New Issue
Block a user