Skip to content

Commit 1489b27

Browse files
committed
fix judge register val
1 parent aff5a57 commit 1489b27

4 files changed

Lines changed: 24 additions & 9 deletions

File tree

app/(pages)/judges/_components/AuthForms/CheckInForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default function CheckInForm({ id }: any) {
3636
<AuthForm
3737
role="judge"
3838
fields={formFields}
39-
buttonText="Check in"
39+
buttonText="Check in"
4040
initialValues={{
4141
code: '',
4242
opted_into_panels: false,

app/(pages)/judges/_components/AuthForms/DetailForm.module.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
width: 100%;
33
height: 60vh;
44
max-height: 100vh;
5-
background-color: #F2F2F7;
65
border-radius: var(--b-radius);
76
display: flex;
87
flex-direction: column;

app/(pages)/judges/_components/AuthForms/DetailForm.tsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,24 @@ interface OptionItem {
1818
rank: number;
1919
}
2020

21+
// Medtech was not appearing as an option, causing failed document validation
22+
const extraDomainOptions: Array<{ text: string; domain: string }> = [
23+
{ text: 'MedTech', domain: 'medtech' },
24+
];
25+
2126
const initialOptions = [
22-
...new Set(
23-
Object.values(optedHDTracks).map((track) => track.domainDisplayName ?? '')
24-
),
27+
...new Set([
28+
...Object.values(optedHDTracks).map(
29+
(track) => track.domainDisplayName ?? ''
30+
),
31+
...extraDomainOptions.map((option) => option.text),
32+
]),
2533
].filter((option) => option !== '');
2634

35+
const extraDisplayNameToDomainMap: Map<string, string> = new Map(
36+
extraDomainOptions.map((option) => [option.text, option.domain])
37+
);
38+
2739
export default function DetailForm({ id }: any) {
2840
const router = useRouter();
2941

@@ -102,9 +114,13 @@ export default function DetailForm({ id }: any) {
102114
setLoading(true);
103115
setError('');
104116

105-
const specialties: string[] = options.map(
106-
(option) => displayNameToDomainMap.get(option.text) ?? ''
107-
);
117+
const specialties: string[] = options.map((option) => {
118+
return (
119+
displayNameToDomainMap.get(option.text) ??
120+
extraDisplayNameToDomainMap.get(option.text) ??
121+
''
122+
);
123+
});
108124

109125
const userRes = await updateUser(id, {
110126
$set: {

app/(pages)/judges/_components/AuthForms/RegisterForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default function RegisterForm({ data }: any) {
5757
<AuthForm
5858
role="judge"
5959
fields={formFields}
60-
buttonText="Next"
60+
buttonText="Next"
6161
initialValues={{
6262
email: data?.email ?? '',
6363
password: '',

0 commit comments

Comments
 (0)