Solved a bug with the UserCard

This commit is contained in:
Tiago Ribeiro
2024-01-16 16:30:38 +00:00
parent c5007a316f
commit d0b0dfb16f
2 changed files with 3 additions and 9 deletions

View File

@@ -79,13 +79,7 @@ function UserProfile({user, mutateUser}: Props) {
const [passport_id, setPassportID] = useState<string | undefined>(user.type === "student" ? user.demographicInformation?.passport_id : undefined);
const [position, setPosition] = useState<string | undefined>(user.type === "corporate" ? user.demographicInformation?.position : undefined);
const [corporateInformation, setCorporateInformation] = useState(user.type === "corporate" ? user.corporateInformation : undefined);
const [companyName, setCompanyName] = useState<string | undefined>(
user.type === "agent"
? user.agentInformation?.companyName
: user.type === "corporate"
? user.corporateInformation?.companyInformation.name
: undefined,
);
const [companyName, setCompanyName] = useState<string | undefined>(user.type === "agent" ? user.agentInformation?.companyName : undefined);
const [commercialRegistration, setCommercialRegistration] = useState<string | undefined>(
user.type === "agent" ? user.agentInformation?.commercialRegistration : undefined,
);