Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
18df56887d
commit
b0b01b3b6c
@@ -759,9 +759,9 @@ function ImportPage() {
|
||||
const existingByExternalId = new Map(
|
||||
(existing ?? []).map((entry: { id: string; external_id: string | null }) => [entry.external_id, entry.id]),
|
||||
);
|
||||
const toUpdate = withConflict
|
||||
const toUpdate: Array<Row & { id: string }> = withConflict
|
||||
.filter((r) => existingByExternalId.has(String(r.external_id)))
|
||||
.map((r) => ({ ...r, id: existingByExternalId.get(String(r.external_id))! }));
|
||||
.map((r) => ({ ...r, id: existingByExternalId.get(String(r.external_id)) as string }));
|
||||
const toInsert = withConflict.filter((r) => !existingByExternalId.has(String(r.external_id)));
|
||||
|
||||
if (toUpdate.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user