aboutsummaryrefslogtreecommitdiff
path: root/modern/src/UserPage.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/UserPage.js')
-rw-r--r--modern/src/UserPage.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/modern/src/UserPage.js b/modern/src/UserPage.js
index 895dac43..ce1e082f 100644
--- a/modern/src/UserPage.js
+++ b/modern/src/UserPage.js
@@ -25,10 +25,11 @@ const UserPage = () => {
const [item, setItem] = useState();
+ const validate = () => item && item.name && item.email && (item.id || item.password);
+
return (
- <EditItemView endpoint="users" item={item} setItem={setItem}>
- {item
- && (
+ <EditItemView endpoint="users" item={item} setItem={setItem} validate={validate}>
+ {item && (
<>
<Accordion defaultExpanded>
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
@@ -97,8 +98,7 @@ const UserPage = () => {
/>
</AccordionDetails>
</Accordion>
- {item.id
- && (
+ {item.id && (
<Accordion>
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
<Typography variant="subtitle1">
@@ -128,9 +128,9 @@ const UserPage = () => {
/>
</AccordionDetails>
</Accordion>
- )}
+ )}
</>
- )}
+ )}
</EditItemView>
);
};