ENCOA-147: Uploading a batch of multiple users is now unrestricted by firebase auth request quotas

This commit is contained in:
Carlos Mesquita
2024-09-03 20:13:04 +01:00
parent 763452e3cc
commit 60554d8e16
6 changed files with 159 additions and 2 deletions

View File

@@ -125,7 +125,7 @@ export default function BatchCreateUser({user, users, permissions, onFinish}: Pr
demographicInformation: {
country: countryItem?.countryCode,
passport_id: passport_id?.toString().trim() || undefined,
phone,
phone: phone.toString(),
},
}
: undefined;
@@ -161,7 +161,7 @@ export default function BatchCreateUser({user, users, permissions, onFinish}: Pr
setIsLoading(true);
try {
for (const newUser of newUsers) await axios.post("/api/make_user", {...newUser, type, expiryDate});
await axios.post("/api/batch_users", { users: newUsers.map(user => ({...user, type, expiryDate})) });
toast.success(`Successfully added ${newUsers.length} user(s)!`);
onFinish();
} catch {