-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
323c18d
commit 2b5e5c4
Showing
2 changed files
with
8 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ import { postData } from '../../util/api'; | |
|
||
function InviteUserButton() { | ||
const [open, setOpen] = useState(false); | ||
const [email, setEmail] = useState(''); | ||
const [emails, setEmails] = useState(''); | ||
const [error, setError] = useState(''); | ||
const [loading, setLoading] = useState(false); | ||
|
||
|
@@ -27,11 +27,11 @@ function InviteUserButton() { | |
|
||
const handleInvite = async () => { | ||
setLoading(true); | ||
postData('admin/invite', { email }).then((res) => { | ||
postData('admin/invite', { emails }).then((res) => { | ||
if (res.error) { | ||
setError(res.error.message); | ||
} else { | ||
setAlert(`${email} successfully invited!`, AlertType.SUCCESS); | ||
setAlert(`${emails} successfully invited!`, AlertType.SUCCESS); | ||
setOpen(false); | ||
} | ||
setLoading(false); | ||
|
@@ -40,7 +40,7 @@ function InviteUserButton() { | |
|
||
const updateEmail = (event: React.ChangeEvent<HTMLInputElement>) => { | ||
setError(''); | ||
setEmail(event.target.value); | ||
setEmails(event.target.value); | ||
}; | ||
|
||
return ( | ||
|
@@ -51,15 +51,14 @@ function InviteUserButton() { | |
<Dialog open={open} onClose={handleClose}> | ||
<DialogContent> | ||
<DialogContentText> | ||
Please enter one or more email addresses separated by commas and | ||
role of the user you would like to invite. (ex. [email protected], | ||
[email protected]) | ||
Please enter one or more email addresses separated by commas. (ex. | ||
[email protected], [email protected]) | ||
</DialogContentText> | ||
<TextField | ||
autoFocus | ||
margin="dense" | ||
id="name" | ||
label="Email Address" | ||
label="Email Addresses" | ||
type="email" | ||
fullWidth | ||
variant="standard" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters