Skip to content

Commit c74ef9e

Browse files
committed
feat(): added none value checkbox and made it required field
1 parent 4332e5e commit c74ef9e

File tree

1 file changed

+4
-2
lines changed
  • src/pages/EpisodeDetails/components/ExpandableContainer/components

1 file changed

+4
-2
lines changed

src/pages/EpisodeDetails/components/ExpandableContainer/components/Discharge.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const POST_OPERATIVE_COMPLICATIONS = [
2424
{ label: 'Urinary Retention' },
2525
{ label: 'Return to theatre' },
2626
{ label: 'Death' },
27+
{ label: 'None' },
2728
];
2829

2930
const Discharge: FC<{
@@ -45,7 +46,7 @@ const Discharge: FC<{
4546
mutate(form);
4647
};
4748

48-
const canSubmit = discharge?.infection === undefined;
49+
const canSubmit = discharge?.infection == undefined;
4950

5051
return (
5152
<InternalContainer isOpen={isOpen} aria-expanded={isOpen}>
@@ -186,6 +187,7 @@ const Discharge: FC<{
186187
value={option.label}
187188
label={option.label}
188189
component={Checkbox}
190+
required={canSubmit}
189191
disabled={!canSubmit}
190192
/>
191193
</div>
@@ -218,7 +220,7 @@ const Discharge: FC<{
218220
color={'blue-200'}
219221
buttonType="button"
220222
onClick={handleSubmit}
221-
disabled={isLoading || !canSubmit}
223+
disabled={isLoading || !canSubmit || !values.infection}
222224
block
223225
size="md"
224226
>

0 commit comments

Comments
 (0)