ENCOA-98: Change the template on the Excel import Function

This commit is contained in:
Tiago Ribeiro
2024-08-23 16:59:08 +01:00
parent 33fd6ddf8f
commit 3e21538d02
2 changed files with 35 additions and 3 deletions

View File

@@ -104,7 +104,7 @@ export default function BatchCreateUser({user}: {user: User}) {
const information = uniqBy(
rows
.map((row) => {
const [firstName, lastName, country, passport_id, email, phone, group, studentID] = row as string[];
const [firstName, lastName, country, passport_id, email, phone, group, studentID, corporate] = row as string[];
const countryItem =
countryCodes.findOne("countryCode" as any, country.toUpperCase()) ||
countryCodes.all().find((x) => x.countryNameEn.toLowerCase() === country.toLowerCase());
@@ -116,6 +116,7 @@ export default function BatchCreateUser({user}: {user: User}) {
type: type,
passport_id: passport_id?.toString().trim() || undefined,
groupName: group,
corporate,
studentID,
demographicInformation: {
country: countryItem?.countryCode,
@@ -184,6 +185,7 @@ export default function BatchCreateUser({user}: {user: User}) {
<th className="border border-neutral-200 px-2 py-1">Phone Number</th>
<th className="border border-neutral-200 px-2 py-1">Group Name</th>
<th className="border border-neutral-200 px-2 py-1">Student ID</th>
{user?.type !== "corporate" && <th className="border border-neutral-200 px-2 py-1">Corporate (e-mail)</th>}
</tr>
</thead>
</table>