Updated the Group creation modal to use Excel
This commit is contained in:
@@ -38,7 +38,7 @@ export default function BatchCodeGenerator({user}: {user: User}) {
|
||||
|
||||
const {users} = useUsers();
|
||||
|
||||
const {openFilePicker, filesContent} = useFilePicker({
|
||||
const {openFilePicker, filesContent, clear} = useFilePicker({
|
||||
accept: ".xlsx",
|
||||
multiple: false,
|
||||
readAs: "ArrayBuffer",
|
||||
@@ -74,10 +74,12 @@ export default function BatchCodeGenerator({user}: {user: User}) {
|
||||
(x) => x.email,
|
||||
);
|
||||
|
||||
if (information.length === 0)
|
||||
return toast.error(
|
||||
if (information.length === 0) {
|
||||
toast.error(
|
||||
"Please upload an Excel file containing user information, one per line! All already registered e-mails have also been ignored!",
|
||||
);
|
||||
return clear();
|
||||
}
|
||||
|
||||
setInfos(information);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user