ENCOA-109: Made the modal disappear when a user is created

This commit is contained in:
Tiago Ribeiro
2024-08-27 11:14:29 +01:00
parent 7fb0ed884c
commit b7940087b5
5 changed files with 16 additions and 9 deletions

View File

@@ -55,7 +55,7 @@ const USER_TYPE_PERMISSIONS: {
},
};
export default function BatchCodeGenerator({user}: {user: User}) {
export default function BatchCodeGenerator({user, onFinish}: {user: User; onFinish: () => void}) {
const [infos, setInfos] = useState<{email: string; name: string; passport_id: string}[]>([]);
const [isLoading, setIsLoading] = useState(false);
const [expiryDate, setExpiryDate] = useState<Date | null>(
@@ -165,6 +165,8 @@ export default function BatchCodeGenerator({user}: {user: User}) {
)} codes and they have been notified by e-mail!`,
{toastId: "success"},
);
onFinish();
return;
}