ENCOA-274
This commit is contained in:
@@ -185,12 +185,12 @@ export default function BatchCreateUser({ user, entities = [], permissions, onFi
|
||||
if (!confirm(`You are about to ${[newUsersSentence, existingUsersSentence].filter((x) => !!x).join(" and ")}, are you sure you want to continue?`))
|
||||
return;
|
||||
|
||||
/*Promise.all(duplicatedUsers.map(async (u) => await axios.post(`/api/invites`, {to: u.id, entity, from: user.id})))
|
||||
.then(() => toast.success(`Successfully invited ${duplicatedUsers.length} registered student(s)!`))
|
||||
Promise.all(newUsers.map(async (u) => await axios.post(`/api/invites`, {to: u.id, entity, from: user.id})))
|
||||
.then(() => toast.success(`Successfully invited ${newUsers.length} registered student(s)!`))
|
||||
.finally(() => {
|
||||
if (newUsers.length === 0) setIsLoading(false);
|
||||
});
|
||||
*/
|
||||
|
||||
if (newUsers.length > 0) {
|
||||
setIsLoading(true);
|
||||
|
||||
@@ -392,6 +392,7 @@ export default function BatchCreateUser({ user, entities = [], permissions, onFi
|
||||
<UserTable users={duplicatedUsers} />
|
||||
</div>
|
||||
)}
|
||||
{(duplicatedUsers.length !== 0 && newUsers.length === 0) && <span className="text-red-500 font-bold">The imported .csv only contains duplicated users!</span>}
|
||||
<Button className="my-auto mt-4" onClick={makeUsers} disabled={newUsers.length === 0}>
|
||||
Create {newUsers.length !== 0 ? `${newUsers.length} New Users` : ''}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user