Prevented an error that should only happen if the user had the type changed directly on the DB for testing purposes

This commit is contained in:
Joao Ramos
2024-01-11 14:18:57 +00:00
parent a91539ec61
commit c781c10fe9

View File

@@ -811,14 +811,14 @@ export default function PaymentRecord() {
options={(users.filter((u) => u.type === "corporate") as CorporateUser[]).map((user) => ({ options={(users.filter((u) => u.type === "corporate") as CorporateUser[]).map((user) => ({
value: user.id, value: user.id,
meta: user, meta: user,
label: `${user.corporateInformation.companyInformation.name || user.name} - ${user.email}`, label: `${user.corporateInformation?.companyInformation?.name || user.name} - ${user.email}`,
}))} }))}
defaultValue={ defaultValue={
user.type === "corporate" user.type === "corporate"
? { ? {
value: user.id, value: user.id,
meta: user, meta: user,
label: `${user.corporateInformation.companyInformation.name || user.name} - ${user.email}`, label: `${user.corporateInformation?.companyInformation?.name || user.name} - ${user.email}`,
} }
: undefined : undefined
} }