fixed the import thing
This commit is contained in:
@@ -74,12 +74,21 @@ export const actions: Actions = {
|
||||
const record = records[i];
|
||||
const rowNum = i + 2;
|
||||
|
||||
const firstName = String(record['First Name'] ?? '').trim();
|
||||
const lastName = String(record['Last name'] ?? '').trim();
|
||||
let firstName = String(record['First Name'] ?? '').trim();
|
||||
let lastName = String(record['Last name'] ?? '').trim();
|
||||
|
||||
if (!firstName && !lastName) continue;
|
||||
if (!firstName) { errors.push(`Row ${rowNum}: Missing first name`); continue; }
|
||||
if (!lastName) { errors.push(`Row ${rowNum}: Missing last name`); continue; }
|
||||
|
||||
if (!lastName) {
|
||||
lastName = ' ';
|
||||
}
|
||||
|
||||
if (lastName === ' ' && firstName.includes(' ')) {
|
||||
const parts = firstName.split(' ');
|
||||
firstName = parts[0];
|
||||
lastName = parts.slice(1).join(' ');
|
||||
}
|
||||
|
||||
const rawBracket = String(record['Bracket'] ?? '').trim();
|
||||
const rawEvent = String(record['Event'] ?? '').trim();
|
||||
|
||||
Reference in New Issue
Block a user